Fixed an issue where serial, bigserial, and smallserial columns were always shown as different in the schema diff.

pull/7323/head
Akshay Joshi 2024-03-27 16:11:40 +05:30
parent 6ecd7b20f7
commit 8ab78dc40d
3 changed files with 10 additions and 5 deletions

View File

@ -34,6 +34,7 @@ Bug fixes
| `Issue #4413 <https://github.com/pgadmin-org/pgadmin4/issues/4413>`_ - Fixed an issue in Schema Diff where Columns with sequences get altered unnecessarily.
| `Issue #7116 <https://github.com/pgadmin-org/pgadmin4/issues/7116>`_ - Bug fixes and improvements in pgAdmin CLI.
| `Issue #7165 <https://github.com/pgadmin-org/pgadmin4/issues/7165>`_ - Fixed schema diff wrong query generation for table, foreign table and sequence.
| `Issue #7210 <https://github.com/pgadmin-org/pgadmin4/issues/7210>`_ - Fixed an issue where table properties were not updating from properties dialog.
| `Issue #7229 <https://github.com/pgadmin-org/pgadmin4/issues/7229>`_ - Fix an issue in table dialog where changing column name was not syncing table constraints appropriately.
| `Issue #7255 <https://github.com/pgadmin-org/pgadmin4/issues/7255>`_ - Fixed an issue where taking backup of a shared server was using server owner's user name.
| `Issue #7262 <https://github.com/pgadmin-org/pgadmin4/issues/7262>`_ - Fix an issue in editor where replace option in query tool edit menu is not working on non-Mac OS.

View File

@ -1674,7 +1674,7 @@ class TableView(BaseTableView, DataTypeReader, SchemaDiffTableCompare):
return sql
@BaseTableView.check_precondition
def fetch_tables(self, sid, did, scid, tid=None):
def fetch_tables(self, sid, did, scid, tid=None, with_serial_cols=False):
"""
This function will fetch the list of all the tables
and will be used by schema diff.
@ -1683,10 +1683,12 @@ class TableView(BaseTableView, DataTypeReader, SchemaDiffTableCompare):
:param did: Database Id
:param scid: Schema Id
:param tid: Table Id
:param with_serial_cols:
:return: Table dataset
"""
status, res = BaseTableView.fetch_tables(self, sid, did, scid, tid)
status, res = BaseTableView.fetch_tables(self, sid, did, scid, tid,
with_serial_cols)
if not status:
current_app.logger.error(res)
return False

View File

@ -25,7 +25,7 @@ class SchemaDiffTableCompare(SchemaDiffObjectCompare):
'relacl_str', 'setting']
column_keys_to_ignore = ['atttypid', 'edit_types', 'elemoid', 'seqrelid',
'indkey', 'seqtypid', 'defval']
'indkey', 'seqtypid']
constraint_keys_to_ignore = ['relname', 'nspname', 'parent_tbl',
'attrelid', 'adrelid', 'fknsp', 'confrelid',
@ -70,10 +70,12 @@ class SchemaDiffTableCompare(SchemaDiffObjectCompare):
return internal_server_error(errormsg=target_schema)
if 'scid' in source_params and source_params['scid'] is not None:
source_tables = self.fetch_tables(**source_params)
source_tables = self.fetch_tables(**source_params,
with_serial_cols=True)
if 'scid' in target_params and target_params['scid'] is not None:
target_tables = self.fetch_tables(**target_params)
target_tables = self.fetch_tables(**target_params,
with_serial_cols=True)
# If both the dict have no items then return None.
if not (source_tables or target_tables) or (