Fixed keyerror issue in schema diff for 'attnum' and 'edit_types' parameter. Fixes #6755

This commit is contained in:
Akshay Joshi 2021-09-28 15:03:28 +05:30
parent 2265ffc0a7
commit 1569be7866
3 changed files with 3 additions and 7 deletions

View File

@ -31,4 +31,5 @@ Bug fixes
| `Issue #6723 <https://redmine.postgresql.org/issues/6723>`_ - Updated query error row selection color as per dark theme style guide.
| `Issue #6724 <https://redmine.postgresql.org/issues/6724>`_ - Fixed an issue where the drop cascade button enables for Databases.
| `Issue #6736 <https://redmine.postgresql.org/issues/6736>`_ - Fixed an issue where Refresh view options are not working for materialized view.
| `Issue #6755 <https://redmine.postgresql.org/issues/6755>`_ - Fixed keyerror issue in schema diff for 'attnum' and 'edit_types' parameter.
| `Issue #6759 <https://redmine.postgresql.org/issues/6759>`_ - Ensure that RLS names should not be editable in the collection node of properties tab.

View File

@ -170,12 +170,7 @@ class SchemaDiffTableCompare(SchemaDiffObjectCompare):
tmp = copy.deepcopy(item)
if tmp and source != tmp:
tmp_updated = copy.deepcopy(source)
# Preserve the column number
tmp_updated['attnum'] = tmp['attnum']
if item['typname'] not in tmp_updated['edit_types']:
tmp_updated['col_type_conversion'] = False
updated.append(tmp_updated)
updated.append(source)
target_cols.remove(tmp)
elif tmp and source == tmp:
target_cols.remove(tmp)

View File

@ -1276,7 +1276,7 @@ class BaseTableView(PGChildNodeView, BasePartitionTable, VacuumSettings):
"/".join([self.column_template_path,
self._PROPERTIES_SQL]),
tid=tid,
clid=c['attnum'],
clid=c['attnum'] if 'attnum' in c else None,
show_sys_objects=self.blueprint.show_system_objects
)