[vhffs-dev] [700] Added foreign keys constraints for boxes, forwards and ml. |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 700
Author: beuss
Date: 2007-07-09 07:21:10 +0000 (Mon, 09 Jul 2007)
Log Message:
-----------
Added foreign keys constraints for boxes, forwards and ml.
Modified Paths:
--------------
trunk/vhffs-backend/src/pgsql/initdb.sql.in
Modified: trunk/vhffs-backend/src/pgsql/initdb.sql.in
===================================================================
--- trunk/vhffs-backend/src/pgsql/initdb.sql.in 2007-07-08 22:08:38 UTC (rev 699)
+++ trunk/vhffs-backend/src/pgsql/initdb.sql.in 2007-07-09 07:21:10 UTC (rev 700)
@@ -314,11 +314,8 @@
ALTER TABLE vhffs_acl ADD CONSTRAINT fk_vhffs_acl_vhffs_object_dst FOREIGN KEY (target_oid) REFERENCES vhffs_object(object_id) ON DELETE CASCADE;
ALTER TABLE vhffs_acl ADD CONSTRAINT fk_vhffs_acl_vhffs_object_src FOREIGN KEY (granted_oid) REFERENCES vhffs_object(object_id) ON DELETE CASCADE;
-ALTER TABLE vhffs_groups ADD CONSTRAINT fk_vhffs_group_vhffs_object FOREIGN KEY (object_id) REFERENCES vhffs_object(object_id) ON DELETE CASCADE;
-ALTER TABLE vhffs_groups ADD CONSTRAINT fk_vhffs_group_vhffs_users FOREIGN KEY (owner_uid) REFERENCES vhffs_users (uid);
+ALTER TABLE vhffs_boxes ADD CONSTRAINT fk_vhffs_boxes_vhffs_mxdomain FOREIGN KEY (domain) REFERENCES vhffs_mxdomain(domain) ON DELETE CASCADE;
-ALTER TABLE vhffs_users ADD CONSTRAINT fk_vhffs_users_vhffs_object FOREIGN KEY (object_id) REFERENCES vhffs_object (object_id) ON DELETE CASCADE;
-
ALTER TABLE vhffs_cvs ADD CONSTRAINT fk_vhffs_cvs_vhffs_users FOREIGN KEY (owner_uid) REFERENCES vhffs_users(uid);
ALTER TABLE vhffs_cvs ADD CONSTRAINT fk_vhffs_cvs_vhffs_groups FOREIGN KEY (owner_gid) REFERENCES vhffs_groups(gid);
ALTER TABLE vhffs_cvs ADD CONSTRAINT fk_vhffs_cvs_vhffs_object FOREIGN KEY (object_id) REFERENCES vhffs_object(object_id) ON DELETE CASCADE;
@@ -330,37 +327,45 @@
ALTER TABLE vhffs_dns_rr ADD CONSTRAINT fk_vhffs_dns_rr_vhffs_dns FOREIGN KEY (zone) REFERENCES vhffs_dns(dns_id) ON DELETE CASCADE;
ALTER TABLE vhffs_dns_rr ADD CONSTRAINT fk_vhffs_dns_rr_chk_type CHECK (type='A' OR type='AAAA' OR type='CNAME' OR type='HINFO' OR type='MX' OR type='NS' OR type='PTR' OR type='RP' OR type='SRV' OR type='TXT');
+ALTER TABLE vhffs_forward ADD CONSTRAINT fk_vhffs_forward_vhffs_mxdomain FOREIGN KEY (domain) REFERENCES vhffs_mxdomain(domain) ON DELETE CASCADE;
+
+ALTER TABLE vhffs_groups ADD CONSTRAINT fk_vhffs_group_vhffs_object FOREIGN KEY (object_id) REFERENCES vhffs_object(object_id) ON DELETE CASCADE;
+ALTER TABLE vhffs_groups ADD CONSTRAINT fk_vhffs_group_vhffs_users FOREIGN KEY (owner_uid) REFERENCES vhffs_users (uid);
+
+ALTER TABLE vhffs_history ADD CONSTRAINT fk_vhffs_history_vhffs_object FOREIGN KEY (object_id) REFERENCES vhffs_object(object_id) ON DELETE CASCADE;
+
ALTER TABLE vhffs_httpd ADD CONSTRAINT fk_vhffs_httpd_vhffs_users FOREIGN KEY (owner_uid) REFERENCES vhffs_users(uid);
ALTER TABLE vhffs_httpd ADD CONSTRAINT fk_vhffs_httpd_vhffs_groups FOREIGN KEY (owner_gid) REFERENCES vhffs_groups(gid);
-ALTER TABLE vhffs_repository ADD CONSTRAINT fk_vhffs_vhffs_repository_vhffs_users FOREIGN KEY (owner_uid) REFERENCES vhffs_users(uid);
-ALTER TABLE vhffs_repository ADD CONSTRAINT fk_vhffs_vhffs_repository_vhffs_groups FOREIGN KEY (owner_gid) REFERENCES vhffs_groups(gid);
-ALTER TABLE vhffs_repository ADD CONSTRAINT fk_vhffs_vhffs_repository_vhffs_object FOREIGN KEY (object_id) REFERENCES vhffs_object(object_id) ON DELETE CASCADE;
-
-ALTER TABLE vhffs_mxdomain ADD CONSTRAINT fk_vhffs_mxdomain_vhffs_users FOREIGN KEY (owner_uid) REFERENCES vhffs_users(uid);
-ALTER TABLE vhffs_mxdomain ADD CONSTRAINT fk_vhffs_mxdomain_vhffs_groups FOREIGN KEY (owner_gid) REFERENCES vhffs_groups(gid);
-ALTER TABLE vhffs_mxdomain ADD CONSTRAINT fk_vhffs_mxdomain_vhffs_object FOREIGN KEY (object_id) REFERENCES vhffs_object(object_id) ON DELETE CASCADE;
-
ALTER TABLE vhffs_ml ADD CONSTRAINT fk_vhffs_ml_vhffs_users FOREIGN KEY (owner_uid) REFERENCES vhffs_users(uid);
ALTER TABLE vhffs_ml ADD CONSTRAINT fk_vhffs_ml_vhffs_groups FOREIGN KEY (owner_gid) REFERENCES vhffs_groups(gid);
ALTER TABLE vhffs_ml ADD CONSTRAINT fk_vhffs_ml_vhffs_object FOREIGN KEY (object_id) REFERENCES vhffs_object(object_id) ON DELETE CASCADE;
+ALTER TABLE vhffs_ml ADD CONSTRAINT fk_vhffs_ml_vhffs_mxdomain FOREIGN KEY (domain) REFERENCES vhffs_mxdomain(domain) ON DELETE CASCADE;
ALTER TABLE vhffs_ml_subscribers ADD CONSTRAINT fk_vhffs_ml_subscribers_vhffs_ml FOREIGN KEY (ml_id) REFERENCES vhffs_ml(ml_id) ON DELETE CASCADE;
+ALTER TABLE vhffs_mxdomain ADD CONSTRAINT fk_vhffs_mxdomain_vhffs_users FOREIGN KEY (owner_uid) REFERENCES vhffs_users(uid);
+ALTER TABLE vhffs_mxdomain ADD CONSTRAINT fk_vhffs_mxdomain_vhffs_groups FOREIGN KEY (owner_gid) REFERENCES vhffs_groups(gid);
+ALTER TABLE vhffs_mxdomain ADD CONSTRAINT fk_vhffs_mxdomain_vhffs_object FOREIGN KEY (object_id) REFERENCES vhffs_object(object_id) ON DELETE CASCADE;
+
ALTER TABLE vhffs_mysql ADD CONSTRAINT fk_vhffs_mysql_vhffs_users FOREIGN KEY (owner_uid) REFERENCES vhffs_users(uid);
ALTER TABLE vhffs_mysql ADD CONSTRAINT fk_vhffs_mysql_vhffs_groups FOREIGN KEY (owner_gid) REFERENCES vhffs_groups(gid);
ALTER TABLE vhffs_mysql ADD CONSTRAINT fk_vhffs_mysql_vhffs_object FOREIGN KEY (object_id) REFERENCES vhffs_object(object_id) ON DELETE CASCADE;
-ALTER TABLE vhffs_history ADD CONSTRAINT fk_vhffs_history_vhffs_object FOREIGN KEY (object_id) REFERENCES vhffs_object(object_id) ON DELETE CASCADE;
-
ALTER TABLE vhffs_pgsql ADD CONSTRAINT fk_vhffs_pgsql_vhffs_users FOREIGN KEY (owner_uid) REFERENCES vhffs_users(uid);
ALTER TABLE vhffs_pgsql ADD CONSTRAINT fk_vhffs_pgsql_vhffs_groups FOREIGN KEY (owner_gid) REFERENCES vhffs_groups(gid);
ALTER TABLE vhffs_pgsql ADD CONSTRAINT fk_vhffs_pgsql_vhffs_object FOREIGN KEY (object_id) REFERENCES vhffs_object(object_id) ON DELETE CASCADE;
+ALTER TABLE vhffs_repository ADD CONSTRAINT fk_vhffs_vhffs_repository_vhffs_users FOREIGN KEY (owner_uid) REFERENCES vhffs_users(uid);
+ALTER TABLE vhffs_repository ADD CONSTRAINT fk_vhffs_vhffs_repository_vhffs_groups FOREIGN KEY (owner_gid) REFERENCES vhffs_groups(gid);
+ALTER TABLE vhffs_repository ADD CONSTRAINT fk_vhffs_vhffs_repository_vhffs_object FOREIGN KEY (object_id) REFERENCES vhffs_object(object_id) ON DELETE CASCADE;
+
ALTER TABLE vhffs_svn ADD CONSTRAINT fk_vhffs_svn_vhffs_users FOREIGN KEY (owner_uid) REFERENCES vhffs_users(uid);
ALTER TABLE vhffs_svn ADD CONSTRAINT fk_vhffs_svn_vhffs_groups FOREIGN KEY (owner_gid) REFERENCES vhffs_groups(gid);
ALTER TABLE vhffs_svn ADD CONSTRAINT fk_vhffs_svn_vhffs_object FOREIGN KEY (object_id) REFERENCES vhffs_object(object_id) ON DELETE CASCADE;
+ALTER TABLE vhffs_users ADD CONSTRAINT fk_vhffs_users_vhffs_object FOREIGN KEY (object_id) REFERENCES vhffs_object (object_id) ON DELETE CASCADE;
+
ALTER TABLE vhffs_user_group ADD CONSTRAINT fk_vhffs_user_group_vhffs_users FOREIGN KEY (uid) REFERENCES vhffs_users (uid) ON DELETE CASCADE;
ALTER TABLE vhffs_user_group ADD CONSTRAINT fk_vhffs_user_group_vhffs_groups FOREIGN KEY (gid) REFERENCES vhffs_groups (gid) ON DELETE CASCADE;