[vhffs-dev] [1172] Forgot to add tag requests table. |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 1172
Author: beuss
Date: 2008-03-07 07:08:57 +0000 (Fri, 07 Mar 2008)
Log Message:
-----------
Forgot to add tag requests table.
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-03 12:37:47 UTC (rev 1171)
+++ trunk/vhffs-backend/src/pgsql/initdb.sql.in 2008-03-07 07:08:57 UTC (rev 1172)
@@ -442,6 +442,22 @@
CONSTRAINT vhffs_tag_category_translation_pkey PRIMARY KEY( tag_category_id, lang )
) WITH OIDS;
+-- Tags requested by users
+
+CREATE TABLE vhffs_tag_request (
+ tag_request_id int4 NOT NULL,
+-- Label of the category. We could have a label
+-- and an id and fill in the correct field depending
+-- of the existence of the category
+ category_label VARCHAR(30) NOT NULL,
+ tag_label VARCHAR(30) NOT NULL,
+-- User who requested the tag
+ requester_id int4,
+-- For which object
+ tagged_id int4,
+ CONSTRAINT vhffs_tag_request_pkey PRIMARY KEY( tag_request_id )
+);
+
-- Description & label translation for a tag
CREATE TABLE vhffs_tag_translation (
@@ -454,6 +470,8 @@
CONSTRAINT vhffs_tag_translation_pkey PRIMARY KEY( tag_id, lang )
) WITH OIDS;
+-- Users of a group, groups of an user
+
CREATE TABLE vhffs_user_group
(
uid int4 NOT NULL,
@@ -588,6 +606,8 @@
ALTER TABLE vhffs_tag_translation ADD CONSTRAINT fk_vhffs_tag_translation_vhffs_users FOREIGN KEY( creator_id ) REFERENCES vhffs_users( uid ) ON DELETE SET NULL;
ALTER TABLE vhffs_object_tag ADD CONSTRAINT fk_vhffs_object_tag_vhffs_object FOREIGN KEY ( object_id ) REFERENCES vhffs_object( object_id ) ON DELETE CASCADE;
ALTER TABLE vhffs_object_tag ADD CONSTRAINT fk_vhffs_object_tag_vhffs_tag FOREIGN KEY ( tag_id ) REFERENCES vhffs_tag( tag_id ) ON DELETE CASCADE;
+ALTER TABLE vhffs_tag_request ADD CONSTRAINT fk_vhffs_tag_request_vhffs_user FOREIGN KEY ( requester_id ) REFERENCES vhffs_users( uid ) ON DELETE SET NULL;
+ALTER TABLE vhffs_tag_request ADD CONSTRAINT fk_vhffs_tag_request_vhffs_object FOREIGN KEY ( tagged_id ) REFERENCES vhffs_object( object_id ) ON DELETE SET NULL;
CREATE VIEW vhffs_passwd AS