[vhffs-dev] [1173] Better if we link a tag to its category isn't it ?

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1173
Author:   beuss
Date:     2008-03-14 06:51:19 +0000 (Fri, 14 Mar 2008)

Log Message:
-----------
Better if we link a tag to its category isn't it ?

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	2008-03-07 07:08:57 UTC (rev 1172)
+++ trunk/vhffs-backend/src/pgsql/initdb.sql.in	2008-03-14 06:51:19 UTC (rev 1173)
@@ -415,6 +415,7 @@
     created int8 NOT NULL,
 -- This tag's creator id, null if user has been deleted
     creator_id int4,
+    category_id int4 NOT NULL,
     CONSTRAINT vhffs_tag_pkey PRIMARY KEY( tag_id )
 ) WITH OIDS;
 
@@ -600,6 +601,7 @@
 
 ALTER TABLE vhffs_tag ADD CONSTRAINT fk_vhffs_tag_vhffs_users FOREIGN KEY (creator_id) REFERENCES vhffs_users(uid) ON DELETE SET NULL;
 ALTER TABLE vhffs_tag_category ADD CONSTRAINT fk_vhffs_tag_category_vhffs_users FOREIGN KEY (creator_id) REFERENCES vhffs_users(uid) ON DELETE SET NULL;
+ALTER TABLE vhffs_tag ADD CONSTRAINT fk_vhffs_tag_vhffs_tag_category FOREIGN KEY (category_id) REFERENCES vhffs_tag_category(tag_category_id) ON DELETE CASCADE;
 ALTER TABLE vhffs_tag_category_translation ADD CONSTRAINT fk_vhffs_tag_category_translation_vhffs_tag_category FOREIGN KEY ( tag_category_id ) REFERENCES vhffs_tag_category(tag_category_id) ON DELETE CASCADE;
 ALTER TABLE vhffs_tag_category_translation ADD CONSTRAINT fk_vhffs_tag_category_translation_vhffs_users FOREIGN KEY ( creator_id ) REFERENCES vhffs_users(uid) ON DELETE SET NULL;
 ALTER TABLE vhffs_tag_translation ADD CONSTRAINT fk_vhffs_tag_translation_vhffs_tag FOREIGN KEY( tag_id ) REFERENCES vhffs_tag( tag_id ) ON DELETE CASCADE;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/