Fixed an issue where schema diff marks an identical table as different. Fixes #5350

Fixed an issue where schema diff showing changes in the identical domain constraints. Fixes #5315

Ignore the keys from the source and target list and also sort both the lists.
This commit is contained in:
Akshay Joshi
2020-04-20 18:04:16 +05:30
parent 36a3d4e53b
commit 4692b21bcf
19 changed files with 290 additions and 28 deletions

View File

@@ -1477,7 +1477,7 @@ class ForeignTableView(PGChildNodeView, DataTypeReader,
if 'deleted' in data['columns']:
for item in data['columns']['deleted']:
tmp_columns.remove(item)
data['columns'] = tmp_columns
data['columns'] = tmp_columns
tmp_constraints = []
if 'constraints' in data:
@@ -1502,7 +1502,7 @@ class ForeignTableView(PGChildNodeView, DataTypeReader,
if 'deleted' in data['ftoptions']:
for item in data['ftoptions']['deleted']:
tmp_ftoptions.remove(item)
data['ftoptions'] = tmp_ftoptions
data['ftoptions'] = tmp_ftoptions
SchemaDiffRegistry(blueprint.node_type, ForeignTableView)

View File

@@ -9,5 +9,5 @@ LEFT JOIN pg_namespace nsp ON c.relnamespace = nsp.oid
WHERE
c.relfilenode = {{ vid }};
{% elif (name and nspname) %}
DROP MATERIALIZED VIEW {{ conn|qtIdent(nspname, name) }} {% if cascade %} CASCADE {% endif %}
DROP MATERIALIZED VIEW {{ conn|qtIdent(nspname, name) }} {% if cascade %} CASCADE {% endif %};
{% endif %}

View File

@@ -9,5 +9,5 @@ LEFT JOIN pg_namespace nsp ON c.relnamespace = nsp.oid
WHERE
c.relfilenode = {{ vid }};
{% elif (name and nspname) %}
DROP MATERIALIZED VIEW {{ conn|qtIdent(nspname, name) }} {% if cascade %} CASCADE {% endif %}
DROP MATERIALIZED VIEW {{ conn|qtIdent(nspname, name) }} {% if cascade %} CASCADE {% endif %};
{% endif %}

View File

@@ -9,5 +9,5 @@ LEFT JOIN pg_namespace nsp ON c.relnamespace = nsp.oid
WHERE
c.relfilenode = {{ vid }};
{% elif (name and nspname) %}
DROP MATERIALIZED VIEW {{ conn|qtIdent(nspname, name) }} {% if cascade %} CASCADE {% endif %}
DROP MATERIALIZED VIEW {{ conn|qtIdent(nspname, name) }} {% if cascade %} CASCADE {% endif %};
{% endif %}