update_tables_0.4.x-0.5.pgsql
changeset 71 4c94ba297698
parent 67 e4d25f50164d
child 80 5dedc673524e
equal deleted inserted replaced
70:a3663ad491bf 71:4c94ba297698
    31 INSERT INTO domain_name (domainname, gid, is_primary) 
    31 INSERT INTO domain_name (domainname, gid, is_primary) 
    32     SELECT domainname, gid, TRUE
    32     SELECT domainname, gid, TRUE
    33       FROM domains;
    33       FROM domains;
    34 
    34 
    35 
    35 
       
    36 ALTER TABLE users DROP CONSTRAINT pkye_users;
       
    37 ALTER TABLE users ADD CONSTRAINT  pkey_users PRIMARY KEY (local_part, gid);
    36 ALTER TABLE users DROP CONSTRAINT fkey_users_gid_domains;
    38 ALTER TABLE users DROP CONSTRAINT fkey_users_gid_domains;
    37 ALTER TABLE users ADD CONSTRAINT fkey_users_gid_domain_data FOREIGN KEY (gid)
    39 ALTER TABLE users ADD CONSTRAINT fkey_users_gid_domain_data FOREIGN KEY (gid)
    38     REFERENCES domain_data (gid);
    40     REFERENCES domain_data (gid);
    39 
    41 
    40 ALTER TABLE alias DROP CONSTRAINT fkey_alias_gid_domains;
    42 ALTER TABLE alias DROP CONSTRAINT fkey_alias_gid_domains;