UNIQUE constraint added to login and email fields
[brisk.git] / sql / sql.d / 001-struct.sql
index a95af6b..024d58f 100644 (file)
@@ -4,15 +4,15 @@
 
 DROP TABLE #PFX#users;
 CREATE TABLE #PFX#users (
-                        code  integer PRIMARY KEY,
-                        login text,
+                        code  SERIAL PRIMARY KEY,
+                        login text UNIQUE,
                         pass  text,
-                        email text,
+                        email text UNIQUE,
                         type  integer
                         );
 
 DROP TABLE #PFX#groups;
 CREATE TABLE #PFX#groups (
-                        code  integer PRIMARY KEY,
+                        code  SERIAL PRIMARY KEY,
                         gname text
                         );