Skip to content

Commit

Permalink
always return union for original statement as well
Browse files Browse the repository at this point in the history
  • Loading branch information
toluaina committed Apr 26, 2021
1 parent 77e12b5 commit d68e695
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pgsync/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ def _foreign_key_view_statement(
table_constraints.c.table_name
)

unions = []
unions = [statement]
if FOREIGN_KEY_VIEWNAME in views:
values = self.fetchall(sa.select([
sa.column('table_name'),
Expand Down Expand Up @@ -580,10 +580,7 @@ def _foreign_key_view_statement(
)
)

if unions:
statement = sa.union(*unions)

return statement
return sa.union(*unions)

def create_views(self, schema, tables, user_defined_fkey_tables):

Expand Down

0 comments on commit d68e695

Please sign in to comment.