Mercurial > gemma
annotate schema/updates/1423/01.axis_as_multilinestring.sql @ 5267:aca4bf7af270
client: remove mapState from import statement
author | Fadi Abbud <fadi.abbud@intevation.de> |
---|---|
date | Wed, 10 Jun 2020 16:33:10 +0200 |
parents | e8b2dc771f9e |
children |
rev | line source |
---|---|
5009
e8b2dc771f9e
Store axis as MultiLinestring
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
1 -- Cannot alter type of a column used in a trigger definition |
e8b2dc771f9e
Store axis as MultiLinestring
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
2 DROP TRIGGER waterway_axis_wtwaxs_unique ON waterway.waterway_axis; |
e8b2dc771f9e
Store axis as MultiLinestring
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
3 |
e8b2dc771f9e
Store axis as MultiLinestring
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
4 ALTER TABLE waterway.waterway_axis |
e8b2dc771f9e
Store axis as MultiLinestring
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
5 ALTER wtwaxs TYPE geography(MULTILINESTRING, 4326) |
e8b2dc771f9e
Store axis as MultiLinestring
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
6 USING ST_Multi(CAST(wtwaxs AS geometry)); |
e8b2dc771f9e
Store axis as MultiLinestring
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
7 |
e8b2dc771f9e
Store axis as MultiLinestring
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
8 -- Re-create trigger |
e8b2dc771f9e
Store axis as MultiLinestring
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
9 CREATE CONSTRAINT TRIGGER waterway_axis_wtwaxs_unique |
e8b2dc771f9e
Store axis as MultiLinestring
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
10 AFTER INSERT OR UPDATE OF wtwaxs ON waterway.waterway_axis |
e8b2dc771f9e
Store axis as MultiLinestring
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
11 FOR EACH ROW EXECUTE FUNCTION prevent_st_equals('wtwaxs'); |