Fixed RESQL test case for Domain and add missing 'COMMENT ON CONSTRAINT' statements.

This commit is contained in:
Akshay Joshi 2022-05-24 16:51:01 +05:30
parent c5ca45c461
commit 2c013c9f0f
3 changed files with 17 additions and 1 deletions

View File

@ -17,8 +17,8 @@ ALTER DOMAIN {{ conn|qtIdent(data.basensp, data.name) }} OWNER TO {{ conn|qtIden
ALTER DOMAIN {{ conn|qtIdent(data.basensp, data.name) }}
ADD CONSTRAINT {{ conn|qtIdent(c.conname) }} CHECK ({{ c.consrc }}){% if not c.convalidated %} NOT VALID{% endif %}{% endif -%};
{% if c.description %}
COMMENT ON CONSTRAINT {{ conn|qtIdent(c.conname) }} ON DOMAIN {{ conn|qtIdent(data.basensp, data.name) }}
IS '{{ c.description }}';
{% endif %}

View File

@ -22,11 +22,21 @@ ALTER DOMAIN {{ conn|qtIdent(o_data.basensp, o_data.name) }} OWNER TO {% if data
ALTER DOMAIN {{ conn|qtIdent(o_data.basensp, o_data.name) }}
ADD CONSTRAINT {{ conn|qtIdent(c.conname) }} CHECK ({{ c.consrc }}){% if not c.convalidated %} NOT VALID{% endif %}{% endif -%};
{% if c.description %}
COMMENT ON CONSTRAINT {{ conn|qtIdent(c.conname) }} ON DOMAIN {{ conn|qtIdent(o_data.basensp, o_data.name) }}
IS '{{ c.description }}';
{% endif %}
{% endfor -%}
{% for c in data.constraints.changed %}{% if c.conname and c.consrc %}
ALTER DOMAIN {{ conn|qtIdent(o_data.basensp, o_data.name) }}
ADD CONSTRAINT {{ conn|qtIdent(c.conname) }} CHECK ({{ c.consrc }}){% if not c.convalidated %} NOT VALID{% endif %}{% endif -%};
{% if c.description %}
COMMENT ON CONSTRAINT {{ conn|qtIdent(c.conname) }} ON DOMAIN {{ conn|qtIdent(o_data.basensp, o_data.name) }}
IS '{{ c.description }}';
{% endif %}
{% endfor -%}
{% endif %}

View File

@ -65,6 +65,12 @@ ALTER DOMAIN {{ conn|qtIdent(o_data.basensp, name) }}
ALTER DOMAIN {{ conn|qtIdent(o_data.basensp, name) }}
ADD CONSTRAINT {{ conn|qtIdent(c.conname) }} CHECK ({{ c.consrc }}){% if not c.convalidated %} NOT VALID{% endif %}{% if c.connoinherit %} NO INHERIT{% endif -%};{% endif -%}
{% if c.description %}
COMMENT ON CONSTRAINT {{ conn|qtIdent(c.conname) }} ON DOMAIN {{ conn|qtIdent(o_data.basensp, name) }}
IS '{{ c.description }}';
{% endif %}
{% endfor -%}{% endif -%}
{% set seclabels = data.seclabels %}
{% if 'deleted' in seclabels and seclabels.deleted|length > 0 %}