changeset 234:55dce2f649bc

Allow using the same email-address for multiple users This can be useful at least in testing scenarios, where one person wants to have multiple accounts with different roles and there is no other reason to enforce uniqueness.
author Tom Gottfried <tom@intevation.de>
date Thu, 26 Jul 2018 15:10:22 +0200
parents 531d1f8a2b4b
children 664fe6536141
files schema/gemma.sql schema/manage_users_tests.sql schema/run_tests.sh
diffstat 3 files changed, 2 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/schema/gemma.sql	Thu Jul 26 15:02:19 2018 +0200
+++ b/schema/gemma.sql	Thu Jul 26 15:10:22 2018 +0200
@@ -137,7 +137,7 @@
         username varchar PRIMARY KEY,
         country char(2) NOT NULL REFERENCES responsibility_areas,
         map_extent box2d NOT NULL,
-        email_address varchar NOT NULL UNIQUE
+        email_address varchar NOT NULL
     )
 
     CREATE TABLE templates (
--- a/schema/manage_users_tests.sql	Thu Jul 26 15:02:19 2018 +0200
+++ b/schema/manage_users_tests.sql	Thu Jul 26 15:10:22 2018 +0200
@@ -53,13 +53,6 @@
     23505, NULL,
     'No duplicate user name is allowed');
 
-SELECT throws_ok($$
-    SELECT sys_admin.create_user(
-        'waterway_user', 'test2', 'secret', 'AT', NULL, 'xxx')
-    $$,
-    23505, NULL,
-    'No duplicate e-mail address is allowed');
-
 --
 -- Role update
 --
--- a/schema/run_tests.sh	Thu Jul 26 15:02:19 2018 +0200
+++ b/schema/run_tests.sh	Thu Jul 26 15:10:22 2018 +0200
@@ -19,7 +19,7 @@
 psql -qXv ON_ERROR_STOP= -v -d gemma_test \
     -c "DROP ROLE IF EXISTS $TEST_ROLES" \
     -f tap_tests_data.sql \
-    -c 'SELECT plan(36)' \
+    -c 'SELECT plan(35)' \
     -f auth_tests.sql \
     -f manage_users_tests.sql \
     -c 'SELECT * FROM finish()'