view schema/updates/1303/01.add_key_column.sql @ 5560:f2204f91d286

Join the log lines of imports to the log exports to recover data from them. Used in SR export to extract information that where in the meta json but now are only found in the log.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 09 Feb 2022 18:34:40 +0100
parents 443867b548b5
children
line wrap: on
line source

ALTER TABLE sys_admin.published_services ADD key_column varchar;

UPDATE sys_admin.published_services SET key_column = 'isrs_code'
    WHERE schema = 'waterway' AND name = 'gauges_geoserver';
UPDATE sys_admin.published_services SET key_column = 'id'
    WHERE schema = 'waterway'
        AND name IN(
            'sections_geoserver',
            'stretches_geoserver',
            'distance_marks_ashore_geoserver',
            'bottlenecks_geoserver');
UPDATE sys_admin.published_services SET key_column = 'location'
    WHERE schema = 'waterway' AND name = 'distance_marks_geoserver';

DROP TABLE waterway.gt_pk_metadata