pgsql/{create,update}_tables*: Added the ON DELETE CASCADE clause v0.6.x
authorPascal Volk <neverseen@users.sourceforge.net>
Tue, 08 Feb 2011 13:43:35 +0000
branchv0.6.x
changeset 387 05dc4e1f8dff
parent 386 b7854259ad74
child 388 dd95ed5bc9d2
pgsql/{create,update}_tables*: Added the ON DELETE CASCADE clause to table userquota{,_11}'s foreign-key constraint fkey_userquota_uid_users.
pgsql/create_tables-dovecot-1.2.x.pgsql
pgsql/create_tables.pgsql
pgsql/update_tables_0.5.x-0.6-dovecot-1.2.x.pgsql
pgsql/update_tables_0.5.x-0.6.pgsql
--- a/pgsql/create_tables-dovecot-1.2.x.pgsql	Mon Feb 07 21:50:44 2011 +0000
+++ b/pgsql/create_tables-dovecot-1.2.x.pgsql	Tue Feb 08 13:43:35 2011 +0000
@@ -119,7 +119,7 @@
     messages    integer NOT NULL DEFAULT 0,
     CONSTRAINT  pkey_userquota PRIMARY KEY (uid),
     CONSTRAINT  fkey_userquota_uid_users FOREIGN KEY (uid)
-        REFERENCES users (uid)
+        REFERENCES users (uid) ON DELETE CASCADE
 );
 
 CREATE TABLE alias (
--- a/pgsql/create_tables.pgsql	Mon Feb 07 21:50:44 2011 +0000
+++ b/pgsql/create_tables.pgsql	Tue Feb 08 13:43:35 2011 +0000
@@ -119,7 +119,7 @@
     current     bigint NOT NULL DEFAULT 0,
     CONSTRAINT  pkey_userquota_11 PRIMARY KEY (uid, path),
     CONSTRAINT  fkey_userquota_11_uid_users FOREIGN KEY (uid)
-        REFERENCES users (uid)
+        REFERENCES users (uid) ON DELETE CASCADE
 );
 
 CREATE TABLE alias (
--- a/pgsql/update_tables_0.5.x-0.6-dovecot-1.2.x.pgsql	Mon Feb 07 21:50:44 2011 +0000
+++ b/pgsql/update_tables_0.5.x-0.6-dovecot-1.2.x.pgsql	Tue Feb 08 13:43:35 2011 +0000
@@ -73,7 +73,7 @@
     messages    integer NOT NULL DEFAULT 0,
     CONSTRAINT  pkey_userquota PRIMARY KEY (uid),
     CONSTRAINT  fkey_userquota_uid_users FOREIGN KEY (uid)
-        REFERENCES users (uid)
+        REFERENCES users (uid) ON DELETE CASCADE
 );
 
 CREATE OR REPLACE FUNCTION merge_userquota() RETURNS TRIGGER AS $$
--- a/pgsql/update_tables_0.5.x-0.6.pgsql	Mon Feb 07 21:50:44 2011 +0000
+++ b/pgsql/update_tables_0.5.x-0.6.pgsql	Tue Feb 08 13:43:35 2011 +0000
@@ -73,7 +73,7 @@
     current     bigint NOT NULL DEFAULT 0,
     CONSTRAINT  pkey_userquota_11 PRIMARY KEY (uid, path),
     CONSTRAINT  fkey_userquota_11_uid_users FOREIGN KEY (uid)
-        REFERENCES users (uid)
+        REFERENCES users (uid) ON DELETE CASCADE
 );
 
 CREATE OR REPLACE FUNCTION merge_userquota_11() RETURNS TRIGGER AS $$