Mercurial > gemma
changeset 2006:35acb7f9ae0c
Do anything else before expectedly failing role creation
Creating roles during database setup expectedly fails in case there
already is another gemma database in the cluster. Doing it at the end
of the transaction ensures it does not hide errors in other commands
in the script.
In passing, add the default admin via the designated view to ensure it
will become a correctly set up application user.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 24 Jan 2019 17:23:43 +0100 |
parents | d8874f78fd7b |
children | dc497b62e073 ec92398b3af7 |
files | schema/std_login_roles.sql |
diffstat | 1 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/schema/std_login_roles.sql Thu Jan 24 16:47:46 2019 +0100 +++ b/schema/std_login_roles.sql Thu Jan 24 17:23:43 2019 +0100 @@ -24,21 +24,21 @@ -- -- Admin User -- --- This initial Admin account is used to bootstrap the personalized --- accounts. -CREATE ROLE sysadmin IN ROLE sys_admin ROLE metamorph LOGIN PASSWORD :'adminpw'; - -- We need an empty dummy country for the default admin, as the user is -- not supposed to work on data, it should be only used to create -- personalized accounts. INSERT INTO countries (country_code) VALUES ('--'); INSERT INTO users.responsibility_areas (country, area) VALUES ('--', ST_GeomFromText('MULTIPOLYGON(((0 0, 1 0, 1 1, 0 1, 0 0)))', 4326)); --- Add user profile data for sysadmin -INSERT INTO internal.user_profiles - (username, country, email_address, map_extent) - VALUES ('sysadmin','--','', - 'BOX(9.52115482500011 46.3786430870001,17.1483378500001 49.0097744750001)'); + +-- This initial Admin account is used to bootstrap the personalized accounts. +INSERT INTO users.list_users VALUES ( + 'sys_admin', + 'sysadmin', + :'adminpw', + '--', + 'BOX(9.52115482500011 46.3786430870001,17.1483378500001 49.0097744750001)', + ''); -- -- Functional Users