Mercurial > gemma
annotate schema/updates/1438/01.remove_duplicate_fairway_areas.sql @ 5540:4d815f295e57 aggregate-gm-import-logging
WIP: Removed more TODOs.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 26 Oct 2021 01:15:30 +0200 |
parents | 20f338cb4d48 |
children |
rev | line source |
---|---|
5155
20f338cb4d48
Add forgotten cleanup of fairway dimensions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
1 -- Remove entries that do not suffice the requirements set out by the |
20f338cb4d48
Add forgotten cleanup of fairway dimensions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
2 -- constraint trigger on fairway_dimensions, but that could be left over |
20f338cb4d48
Add forgotten cleanup of fairway dimensions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
3 -- from an import run before the constraint trigger was in place |
20f338cb4d48
Add forgotten cleanup of fairway dimensions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
4 DELETE FROM waterway.fairway_dimensions fd |
20f338cb4d48
Add forgotten cleanup of fairway dimensions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
5 USING waterway.fairway_dimensions fd_self |
20f338cb4d48
Add forgotten cleanup of fairway dimensions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
6 WHERE ST_Equals(CAST(fd.area AS geometry), CAST(fd_self.area AS geometry)) |
20f338cb4d48
Add forgotten cleanup of fairway dimensions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
7 AND fd.validity && fd_self.validity |
20f338cb4d48
Add forgotten cleanup of fairway dimensions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
8 AND fd.staging_done = fd_self.staging_done |
20f338cb4d48
Add forgotten cleanup of fairway dimensions
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
9 AND fd.id < fd_self.id |