Mercurial > gemma
comparison schema/tap_tests_data.sql @ 195:5dc8e734487a
Introduce database schemas as privilege-based namespaces
Some privileges changed (e.g. for responsibility_areas), but additional
privileges were not left off intentionally before.
Search path settings have been replaced by schema-qualifying names in
statements to prevent object definitions from being dependend on
search path settings.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Fri, 20 Jul 2018 17:28:16 +0200 |
parents | 4df4e4bf480e |
children | 88d21c29cf04 |
comparison
equal
deleted
inserted
replaced
194:cf5dcc1761df | 195:5dc8e734487a |
---|---|
1 SET search_path TO public, gemma, gemma_waterway, gemma_fairway; | 1 -- |
2 -- Test data used in *_tests.sql scripts | |
3 -- | |
2 | 4 |
3 INSERT INTO countries VALUES ('AT'), ('RO'); | 5 INSERT INTO countries VALUES ('AT'), ('RO'); |
4 | 6 |
5 INSERT INTO responsibility_areas VALUES | 7 INSERT INTO users.responsibility_areas VALUES |
6 ('AT', ST_geomfromtext('MULTIPOLYGON(((0 0, 0 1, 1 1, 1 0, 0 0)))', 4326)); | 8 ('AT', ST_geomfromtext('MULTIPOLYGON(((0 0, 0 1, 1 1, 1 0, 0 0)))', 4326)); |
7 | 9 |
8 INSERT INTO user_profiles (username, country, email_adress) | 10 INSERT INTO users.user_profiles (username, country, email_adress) |
9 VALUES | 11 VALUES |
10 ('waterway_user', 'AT', 'xxx'), | 12 ('waterway_user', 'AT', 'xxx'), |
11 ('waterway_user2', 'RO', 'xxy'), | 13 ('waterway_user2', 'RO', 'xxy'), |
12 ('waterway_admin', 'AT', 'yyy'), | 14 ('waterway_admin', 'AT', 'yyy'), |
13 ('sys_admin', 'AT', 'zzz'); | 15 ('sys_admin', 'AT', 'zzz'); |
14 | 16 |
15 INSERT INTO limiting_factors VALUES ('depth'), ('width'); | 17 INSERT INTO limiting_factors VALUES ('depth'), ('width'); |
16 | 18 |
17 INSERT INTO gauges ( | 19 INSERT INTO waterway.gauges ( |
18 location, function_code, objname, geom, zero_point, source_organization) | 20 location, function_code, objname, geom, zero_point, source_organization) |
19 VALUES ( | 21 VALUES ( |
20 ('AT', 'XXX', '00001', '00000', 1)::isrs, | 22 ('AT', 'XXX', '00001', '00000', 1)::isrs, |
21 'xxx', | 23 'xxx', |
22 'testgauge', | 24 'testgauge', |
23 ST_geomfromtext('POINT(0 0)', 4326), | 25 ST_geomfromtext('POINT(0 0)', 4326), |
24 0, | 26 0, |
25 'testorganization' | 27 'testorganization' |
26 ); | 28 ); |
27 | 29 |
28 INSERT INTO bottlenecks ( | 30 INSERT INTO waterway.bottlenecks ( |
29 bottleneck_id, fk_g_fid, stretch, area, rb, lb, responsible_country, | 31 bottleneck_id, fk_g_fid, stretch, area, rb, lb, responsible_country, |
30 revisiting_time, limiting, source_organization, staging_done) | 32 revisiting_time, limiting, source_organization, staging_done) |
31 VALUES ( | 33 VALUES ( |
32 'testbottleneck1', | 34 'testbottleneck1', |
33 ('AT', 'XXX', '00001', '00000', 1)::isrs, | 35 ('AT', 'XXX', '00001', '00000', 1)::isrs, |
44 ST_geomfromtext('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326), | 46 ST_geomfromtext('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326), |
45 'AT', 'AT', 'AT', | 47 'AT', 'AT', 'AT', |
46 1, 'depth', 'testorganization', true | 48 1, 'depth', 'testorganization', true |
47 ); | 49 ); |
48 | 50 |
49 INSERT INTO templates (template_name, template_data) | 51 INSERT INTO users.templates (template_name, template_data) |
50 VALUES ('AT', '\x'), ('RO', '\x'); | 52 VALUES ('AT', '\x'), ('RO', '\x'); |
51 INSERT INTO user_templates | 53 INSERT INTO users.user_templates |
52 VALUES ('waterway_user', 'AT'), ('waterway_user2', 'RO'); | 54 VALUES ('waterway_user', 'AT'), ('waterway_user2', 'RO'); |