pgsql/update_tables_0.5.x-0.6.pgsql
branchv0.6.x
changeset 503 492c179094c9
parent 502 e1b32377032f
child 511 0244f1344b04
equal deleted inserted replaced
502:e1b32377032f 503:492c179094c9
   141 ALTER TABLE users DROP COLUMN managesieve;
   141 ALTER TABLE users DROP COLUMN managesieve;
   142 ALTER TABLE users ADD CONSTRAINT fkey_users_ssid_service_set
   142 ALTER TABLE users ADD CONSTRAINT fkey_users_ssid_service_set
   143     FOREIGN KEY (ssid) REFERENCES service_set (ssid);
   143     FOREIGN KEY (ssid) REFERENCES service_set (ssid);
   144 
   144 
   145 -- ---
   145 -- ---
       
   146 -- Catchall
       
   147 -- ---
       
   148 
       
   149 CREATE TABLE catchall (
       
   150     gid         bigint NOT NULL,
       
   151     destination varchar(320) NOT NULL,
       
   152     CONSTRAINT  pkey_catchall PRIMARY KEY (gid, destination),
       
   153     CONSTRAINT  fkey_catchall_gid_domain_data FOREIGN KEY (gid)
       
   154         REFERENCES domain_data (gid)
       
   155 );
       
   156 
       
   157 -- ---
   146 -- Restore view
   158 -- Restore view
   147 -- ---
   159 -- ---
   148 CREATE VIEW vmm_domain_info AS
   160 CREATE VIEW vmm_domain_info AS
   149     SELECT gid, count(uid) AS accounts,
   161     SELECT gid, count(uid) AS accounts,
   150            (SELECT count(DISTINCT address)
   162            (SELECT count(DISTINCT address)