annotate schema/updates/1310/01.import-changed.sql @ 5248:8c44b518141a new-fwa

Don't intersect with validities when fetching bottleneck_ids for sections and stretches.
author Sascha L. Teichmann <teichmann@intevation.de>
date Tue, 12 May 2020 22:35:33 +0200
parents 47922c1a088d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4748
47922c1a088d Added a 'changed' column to the import.imports table.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
1 ALTER TABLE import.imports ADD COLUMN changed timestamp WITH time zone NOT NULL DEFAULT CURRENT_TIMESTAMP;
47922c1a088d Added a 'changed' column to the import.imports table.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
2
47922c1a088d Added a 'changed' column to the import.imports table.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
3 UPDATE import.imports imp SET
47922c1a088d Added a 'changed' column to the import.imports table.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
4 changed = (SELECT coalesce(max(time), imp.changed)
47922c1a088d Added a 'changed' column to the import.imports table.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
5 FROM import.import_logs
47922c1a088d Added a 'changed' column to the import.imports table.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
6 WHERE import_id = imp.id);