view schema/updates/1310/01.import-changed.sql @ 4837:3b0ec9b56d7c

Merged
author Sascha Wilde <wilde@intevation.de>
date Fri, 08 Nov 2019 13:10:56 +0100
parents 47922c1a088d
children
line wrap: on
line source

ALTER TABLE import.imports ADD COLUMN changed timestamp WITH time zone NOT NULL DEFAULT CURRENT_TIMESTAMP;

UPDATE import.imports imp SET
  changed = (SELECT coalesce(max(time), imp.changed)
             FROM import.import_logs
             WHERE import_id = imp.id);