Fixed incorrect reverse engineering SQL for Foreign key when creating a table. Fixes #5748

This commit is contained in:
Nikhil Mohite 2020-08-25 12:31:58 +05:30 committed by Akshay Joshi
parent 7f947f146c
commit b3d49c61a5
2 changed files with 3 additions and 2 deletions

View File

@ -19,4 +19,5 @@ Housekeeping
Bug fixes
*********
| `Issue #5748 <https://redmine.postgresql.org/issues/5748>`_ - Fixed incorrect reverse engineering SQL for Foreign key when creating a table.
| `Issue #5754 <https://redmine.postgresql.org/issues/5754>`_ - Fixed an issue where schema diff is not working when providing the options to Foreign Data Wrapper, Foreign Server, and User Mapping.

View File

@ -1117,7 +1117,7 @@ class BaseTableView(PGChildNodeView, BasePartitionTable):
sql += '\n' + exclusion_constraint_sql
return sql
def _check_for_foreign_key(self, data):
def _check_fk_constraint(self, data):
if 'foreign_key' in data:
for c in data['foreign_key']:
schema, table = fkey_utils.get_parent(
@ -1250,7 +1250,7 @@ class BaseTableView(PGChildNodeView, BasePartitionTable):
data = column_utils.parse_format_columns(data)
data = BaseTableView.check_and_convert_name_to_string(data)
self._check_foreign_key(data)
self._check_fk_constraint(data)
partitions_sql = self._check_for_partitioned(data)