Mercurial > gemma
annotate schema/updates/1102/01.bn_constraint.sql @ 5347:1fc454da7ee8 extented-report
XLSX templater: To ease debugging enrich error with SQL statement if it fails.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 20 Jun 2021 14:11:13 +0200 |
parents | 24c5eec22c2d |
children |
rev | line source |
---|---|
4111
692aba3e8b85
Change constraints for bottlenecks to include staging_done flag.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
1 ALTER TABLE waterway.bottlenecks |
692aba3e8b85
Change constraints for bottlenecks to include staging_done flag.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
2 DROP CONSTRAINT IF EXISTS bottlenecks_bottleneck_id_validity_key, |
692aba3e8b85
Change constraints for bottlenecks to include staging_done flag.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
3 DROP CONSTRAINT IF EXISTS bottlenecks_bottleneck_id_validity_excl, |
692aba3e8b85
Change constraints for bottlenecks to include staging_done flag.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
4 DROP CONSTRAINT IF EXISTS bottlenecks_bottleneck_id_validity_staging_done_key, |
692aba3e8b85
Change constraints for bottlenecks to include staging_done flag.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
5 DROP CONSTRAINT IF EXISTS bottlenecks_bottleneck_id_validity_staging_done_excl; |
692aba3e8b85
Change constraints for bottlenecks to include staging_done flag.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
6 |
692aba3e8b85
Change constraints for bottlenecks to include staging_done flag.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
7 ALTER TABLE waterway.bottlenecks |
692aba3e8b85
Change constraints for bottlenecks to include staging_done flag.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
8 ADD CONSTRAINT bottlenecks_bottleneck_id_validity_staging_done_key |
692aba3e8b85
Change constraints for bottlenecks to include staging_done flag.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
9 UNIQUE (bottleneck_id, validity, staging_done), |
692aba3e8b85
Change constraints for bottlenecks to include staging_done flag.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
10 ADD CONSTRAINT bottlenecks_bottleneck_id_validity_staging_done_excl |
692aba3e8b85
Change constraints for bottlenecks to include staging_done flag.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
11 EXCLUDE USING GiST (bottleneck_id WITH =, |
692aba3e8b85
Change constraints for bottlenecks to include staging_done flag.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
12 validity WITH &&, |
692aba3e8b85
Change constraints for bottlenecks to include staging_done flag.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
13 CAST(staging_done AS int) WITH =) |
692aba3e8b85
Change constraints for bottlenecks to include staging_done flag.
Sascha Wilde <wilde@intevation.de>
parents:
diff
changeset
|
14 DEFERRABLE INITIALLY DEFERRED; |