Ensure that the schema diff tool should pick up the change in the column grants. #5269

This commit is contained in:
Akshay Joshi 2023-02-13 17:54:38 +05:30
parent 0fd1e0963e
commit f623d563b1
2 changed files with 15 additions and 0 deletions

View File

@ -31,6 +31,7 @@ Housekeeping
Bug fixes
*********
| `Issue #5269 <https://github.com/pgadmin-org/pgadmin4/issues/5269>`_ - Ensure that the schema diff tool should pick up the change in the column grants.
| `Issue #5685 <https://github.com/pgadmin-org/pgadmin4/issues/5685>`_ - Ensure that Grant column permission to a view is visible in the SQL tab.
| `Issue #5758 <https://github.com/pgadmin-org/pgadmin4/issues/5758>`_ - Fixed an issue where lock layout menu was not in sync with preferences.
| `Issue #5764 <https://github.com/pgadmin-org/pgadmin4/issues/5764>`_ - Fix an issue where the maintenance dialog for Materialized View gives an error.

View File

@ -176,6 +176,20 @@ class SchemaDiffTableCompare(SchemaDiffObjectCompare):
source['attnum'] = tmp['attnum']
if tmp and source != tmp:
# check column level grants
acl_dict = dict()
if 'attacl' in source and 'attacl' in tmp and \
source['attacl'] != tmp['attacl']:
if len(source['attacl']) > 0 and len(tmp['attacl']) < 1:
acl_dict['added'] = source['attacl'].copy()
source['attacl'] = acl_dict
elif len(source['attacl']) < 1 and len(tmp['attacl']) > 0:
acl_dict['deleted'] = tmp['attacl'].copy()
source['attacl'] = acl_dict
else:
acl_dict['changed'] = source['attacl'].copy()
source['attacl'] = acl_dict
updated.append(source)
target_cols.remove(tmp)
elif tmp and source == tmp: