create_tables.pgsql
changeset 9 e3d3dbeb5b84
parent 8 7e3ce56f49e6
child 13 1d9bf63a86f7
--- a/create_tables.pgsql	Sat Feb 02 19:48:17 2008 +0000
+++ b/create_tables.pgsql	Sun Mar 02 20:22:00 2008 +0000
@@ -134,3 +134,12 @@
     SELECT count(DISTINCT address) AS aliases, gid
       FROM alias 
   GROUP BY gid;
+
+CREATE OR REPLACE VIEW vmm_domain_info AS
+    SELECT gid, domainname, transport, domaindir, count(uid) AS accounts,
+           aliases
+      FROM domains
+           LEFT JOIN transport USING (tid)
+           LEFT JOIN users USING (gid)
+           LEFT JOIN vmm_alias_count USING (gid)
+  GROUP BY gid, domainname, transport, domaindir, aliases;