Fixed an issue where schema diff does not create DROP DEFAULT statement for columns. Fixes #6377

This commit is contained in:
Akshay Joshi
2021-04-26 16:41:20 +05:30
parent b853bda2a2
commit 7d6f077cf8
3 changed files with 3 additions and 2 deletions

View File

@@ -31,7 +31,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
{% endif %}
{### Drop column default value ###}
{% if data.defval is defined and data.defval == '' and data.defval != o_data.defval %}
{% if data.defval is defined and (data.defval == '' or data.defval is none) and data.defval != o_data.defval %}
ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} DROP DEFAULT;

View File

@@ -31,7 +31,7 @@ ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
{% endif %}
{### Drop column default value ###}
{% if data.defval is defined and data.defval == '' and data.defval != o_data.defval %}
{% if data.defval is defined and (data.defval == '' or data.defval is none) and data.defval != o_data.defval %}
ALTER TABLE {{conn|qtIdent(data.schema, data.table)}}
ALTER COLUMN {% if data.name %}{{conn|qtTypeIdent(data.name)}}{% else %}{{conn|qtTypeIdent(o_data.name)}}{% endif %} DROP DEFAULT;