view schema/tap_tests_data.sql @ 209:9585982180ab

Remove obsolete TODO comment Users can write in this table only through user management functions which ensure consistency.
author Tom Gottfried <tom@intevation.de>
date Mon, 23 Jul 2018 16:14:36 +0200
parents 88d21c29cf04
children e7826710d9c4
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));

SELECT sys_admin.create_user(
    'waterway_user', 'user_at', 'user_at', 'AT', NULL, 'xxx');
SELECT sys_admin.create_user(
    'waterway_user', 'user_ro', 'user_ro', 'RO', NULL, 'xxy');
SELECT sys_admin.create_user(
    'waterway_admin', 'admin_at', 'admin_at', 'AT', NULL, 'yyy');
SELECT sys_admin.create_user(
    'sys_admin', 'sys_admin1', 'sys_admin1', 'AT', NULL, '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 ('user_at', 'AT'), ('user_ro', 'RO');