[vhffs-dev] [1578] add unique constraint on ircnick, added changes in compat script

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


Revision: 1578
Author:   gradator
Date:     2010-03-27 23:31:58 +0100 (Sat, 27 Mar 2010)
Log Message:
-----------
add unique constraint on ircnick, added changes in compat script

Modified Paths:
--------------
    trunk/vhffs-backend/src/pgsql/initdb.sql.in
    trunk/vhffs-compat/from-4.2-to-4.3.sql

Modified: trunk/vhffs-backend/src/pgsql/initdb.sql.in
===================================================================
--- trunk/vhffs-backend/src/pgsql/initdb.sql.in	2010-03-26 23:13:02 UTC (rev 1577)
+++ trunk/vhffs-backend/src/pgsql/initdb.sql.in	2010-03-27 22:31:58 UTC (rev 1578)
@@ -127,9 +127,9 @@
 	theme varchar(250),
 -- Last date user logged in
 	lastloginpanel int8,
-	CONSTRAINT vhffs_users_pkey PRIMARY KEY (uid),
 -- IRC nick
-	ircnick varchar(16)
+	ircnick varchar(16),
+	CONSTRAINT vhffs_users_pkey PRIMARY KEY (uid)
 ) WITH OIDS;
 
 SELECT setval('vhffs_users_uid_seq', @MINUID@) ;
@@ -530,6 +530,7 @@
 
 /****** Indexes and unique constraints *******/
 ALTER TABLE vhffs_users ADD CONSTRAINT vhffs_users_unique_username UNIQUE (username);
+ALTER TABLE vhffs_users ADD CONSTRAINT vhffs_users_unique_ircnick UNIQUE (ircnick);
 ALTER TABLE vhffs_groups ADD CONSTRAINT vhffs_groups_unique_groupname UNIQUE (groupname);
 ALTER TABLE vhffs_cvs ADD CONSTRAINT vhffs_cvs_unique_cvsroot UNIQUE (cvsroot);
 ALTER TABLE vhffs_httpd ADD CONSTRAINT vhffs_httpd_unique_servername UNIQUE (servername);

Modified: trunk/vhffs-compat/from-4.2-to-4.3.sql
===================================================================
--- trunk/vhffs-compat/from-4.2-to-4.3.sql	2010-03-26 23:13:02 UTC (rev 1577)
+++ trunk/vhffs-compat/from-4.2-to-4.3.sql	2010-03-27 22:31:58 UTC (rev 1578)
@@ -20,3 +20,7 @@
 CREATE INDEX idx_vhffs_mercurial_public ON vhffs_mercurial(public);
 CREATE INDEX idx_vhffs_mercurial_object_id ON vhffs_mercurial(object_id);
 ALTER TABLE vhffs_mercurial ADD CONSTRAINT fk_vhffs_mercurial_vhffs_object FOREIGN KEY (object_id) REFERENCES vhffs_object(object_id) ON DELETE CASCADE;
+
+-- add ircnick in vhffs_users
+ALTER TABLE vhffs_users ADD COLUMN ircnick VARCHAR(16) DEFAULT NULL;
+ALTER TABLE vhffs_users ADD CONSTRAINT vhffs_users_unique_ircnick UNIQUE (ircnick);


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