[vhffs-dev] [svn] commit: r290 - in /branches/vhffs_4.1/vhffs-backend/src/pgsql: alter_from4.0_tocurrent.sql initdb.sql |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
- To: vhffs-dev@xxxxxxxxx
- Subject: [vhffs-dev] [svn] commit: r290 - in /branches/vhffs_4.1/vhffs-backend/src/pgsql: alter_from4.0_tocurrent.sql initdb.sql
- From: vhffs-dev@xxxxxxxxx
- Date: Thu, 09 Nov 2006 20:11:52 -0000
Author: beuss
Date: Thu Nov 9 21:11:51 2006
New Revision: 290
Log:
Add an unique index for username so we don't have to check it manually
Modified:
branches/vhffs_4.1/vhffs-backend/src/pgsql/alter_from4.0_tocurrent.sql
branches/vhffs_4.1/vhffs-backend/src/pgsql/initdb.sql
Modified: branches/vhffs_4.1/vhffs-backend/src/pgsql/alter_from4.0_tocurrent.sql
==============================================================================
--- branches/vhffs_4.1/vhffs-backend/src/pgsql/alter_from4.0_tocurrent.sql (original)
+++ branches/vhffs_4.1/vhffs-backend/src/pgsql/alter_from4.0_tocurrent.sql Thu Nov 9 21:11:51 2006
@@ -24,3 +24,5 @@
SELECT setval('vhffs_repository_repository_id_seq', (SELECT COALESCE(MAX(repository_id), 1) FROM vhffs_repository));
SELECT setval('vhffs_svn_svn_id_seq', (SELECT COALESCE(MAX(svn_id), 1) FROM vhffs_svn));
+-- username must be unique
+ALTER TABLE vhffs_users ADD CONSTRAINT unique_username UNIQUE (username);
Modified: branches/vhffs_4.1/vhffs-backend/src/pgsql/initdb.sql
==============================================================================
--- branches/vhffs_4.1/vhffs-backend/src/pgsql/initdb.sql (original)
+++ branches/vhffs_4.1/vhffs-backend/src/pgsql/initdb.sql Thu Nov 9 21:11:51 2006
@@ -365,6 +365,9 @@
) WITH OIDS;
+/****** Indexes and unique constraints *******/
+ALTER TABLE vhffs_users ADD CONSTRAINT unique_username UNIQUE (username);
+
/****** Non primary key constraints.
Defining foreign keys here allow to create tables in any order.
*******/