view 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
line wrap: on
line source

--
-- Test data used in *_tests.sql scripts
--

INSERT INTO countries VALUES ('AT'), ('RO');

INSERT INTO users.responsibility_areas VALUES
    ('AT', ST_geomfromtext('MULTIPOLYGON(((0 0, 0 1, 1 1, 1 0, 0 0)))', 4326));

INSERT INTO users.user_profiles (username, country, email_adress)
    VALUES
    ('waterway_user', 'AT', 'xxx'),
    ('waterway_user2', 'RO', 'xxy'),
    ('waterway_admin', 'AT', 'yyy'),
    ('sys_admin', 'AT', 'zzz');

INSERT INTO limiting_factors VALUES ('depth'), ('width');

INSERT INTO waterway.gauges (
    location, function_code, objname, geom, zero_point, source_organization)
    VALUES (
        ('AT', 'XXX', '00001', '00000', 1)::isrs,
        'xxx',
        'testgauge',
        ST_geomfromtext('POINT(0 0)', 4326),
        0,
        'testorganization'
    );

INSERT INTO waterway.bottlenecks (
    bottleneck_id, fk_g_fid, stretch, area, rb, lb, responsible_country,
    revisiting_time, limiting, source_organization, staging_done)
    VALUES (
        'testbottleneck1',
        ('AT', 'XXX', '00001', '00000', 1)::isrs,
        isrsrange(('AT', 'XXX', '00001', '00000', 0)::isrs,
            ('AT', 'XXX', '00001', '00000', 2)::isrs),
        ST_geomfromtext('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326),
        'AT', 'AT', 'AT',
        1, 'depth', 'testorganization', false
    ), (
        'testbottleneck2',
        ('AT', 'XXX', '00001', '00000', 1)::isrs,
        isrsrange(('AT', 'XXX', '00001', '00000', 0)::isrs,
            ('AT', 'XXX', '00001', '00000', 2)::isrs),
        ST_geomfromtext('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))', 4326),
        'AT', 'AT', 'AT',
        1, 'depth', 'testorganization', true
    );

INSERT INTO users.templates (template_name, template_data)
    VALUES ('AT', '\x'), ('RO', '\x');
INSERT INTO users.user_templates
    VALUES ('waterway_user', 'AT'), ('waterway_user2', 'RO');