[vhffs-dev] [svn] commit: r244 - /trunk/vhffs-backend/src/pgsql/initdb.sql |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Author: gradator
Date: Sat Oct 28 22:52:07 2006
New Revision: 244
Log:
Add required tables to handle repositories;
Modified:
trunk/vhffs-backend/src/pgsql/initdb.sql
Modified: trunk/vhffs-backend/src/pgsql/initdb.sql
==============================================================================
--- trunk/vhffs-backend/src/pgsql/initdb.sql (original)
+++ trunk/vhffs-backend/src/pgsql/initdb.sql Sat Oct 28 22:52:07 2006
@@ -202,6 +202,17 @@
CONSTRAINT vhffs_largefile_pkey PRIMARY KEY( filename , owner_gid)
) WITH OIDS;
+CREATE TABLE vhffs_repository
+(
+ repository_id serial,
+ owner_uid int4 NOT NULL,
+ owner_gid int4 NOT NULL,
+ quota int4 NOT NULL,
+ quota_used int4 NOT NULL DEFAULT 0,
+ object_id int4 NOT NULL,
+ CONSTRAINT vhffs_repository_pkey PRIMARY KEY (repository_id)
+) WITH OIDS;
+
CREATE TABLE vhffs_mailings
(
id_mailing serial,
@@ -393,6 +404,10 @@
ADD CONSTRAINT fk_vhffs_largefile_vhffs_groups FOREIGN KEY (owner_gid) REFERENCES vhffs_groups(gid) ON DELETE CASCADE,
ADD CONSTRAINT fk_vhffs_largefile_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) ON DELETE CASCADE;
+ALTER TABLE vhffs_repository ADD CONSTRAINT fk_vhffs_vhffs_repository_vhffs_groups FOREIGN KEY (owner_gid) REFERENCES vhffs_groups(gid) ON DELETE CASCADE;
+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) ON DELETE CASCADE,
ADD CONSTRAINT fk_vhffs_mxdomain_vhffs_groups FOREIGN KEY (owner_gid) REFERENCES vhffs_groups(gid) ON DELETE CASCADE,