Fix renaming of check constraints when the table name is changed at the same time. Fixes #2201
parent
5e33fe4e95
commit
685b1ea12f
|
@ -1,13 +1,13 @@
|
||||||
{% if data %}
|
{% if data %}
|
||||||
{% if data.name != o_data.name %}
|
{% if data.name != o_data.name %}
|
||||||
ALTER TABLE {{ conn|qtIdent(o_data.nspname, o_data.relname) }}
|
ALTER TABLE {{ conn|qtIdent(o_data.nspname, data.table) }}
|
||||||
RENAME CONSTRAINT {{ conn|qtIdent(o_data.name) }} TO {{ conn|qtIdent(data.name) }};{% endif -%}
|
RENAME CONSTRAINT {{ conn|qtIdent(o_data.name) }} TO {{ conn|qtIdent(data.name) }};{% endif -%}
|
||||||
{% if 'convalidated' in data and o_data.convalidated != data.convalidated and not data.convalidated %}
|
{% if 'convalidated' in data and o_data.convalidated != data.convalidated and not data.convalidated %}
|
||||||
|
|
||||||
ALTER TABLE {{ conn|qtIdent(o_data.nspname, o_data.relname) }}
|
ALTER TABLE {{ conn|qtIdent(o_data.nspname, data.table) }}
|
||||||
VALIDATE CONSTRAINT {{ conn|qtIdent(data.name) }};{% endif -%}
|
VALIDATE CONSTRAINT {{ conn|qtIdent(data.name) }};{% endif -%}
|
||||||
{% if data.comment is defined and data.comment != o_data.comment %}
|
{% if data.comment is defined and data.comment != o_data.comment %}
|
||||||
|
|
||||||
COMMENT ON CONSTRAINT {{ conn|qtIdent(data.name) }} ON {{ conn|qtIdent(o_data.nspname, o_data.relname) }}
|
COMMENT ON CONSTRAINT {{ conn|qtIdent(data.name) }} ON {{ conn|qtIdent(o_data.nspname, data.table) }}
|
||||||
IS {{ data.comment|qtLiteral }};{% endif %}
|
IS {{ data.comment|qtLiteral }};{% endif %}
|
||||||
{% endif -%}
|
{% endif -%}
|
Loading…
Reference in New Issue