fixup! fixup! [IMP] use sqlparse also to determine which ddl to update

This commit is contained in:
Holger Brunn
2022-06-22 10:23:14 +02:00
parent b76c3ed67b
commit 5046e6d000
2 changed files with 7 additions and 2 deletions

View File

@@ -124,11 +124,15 @@ class TestPglogical(TransactionCase):
RETURNS NULL ON NULL INPUT''',
'drop table',
"alter table 'test'",
'ALTER TABLE "testtable" ADD COLUMN "test_field" double precision',
):
qualified_query = ''.join(
''.join(str(token) for token in schema_qualify(parsed_query))
for parsed_query in sqlparse.parse(statement)
)
self.assertEqual(
qualified_query, statement.replace('testtable', 'public.testtable')
qualified_query,
statement.replace('testtable', 'public.testtable').replace(
'"public.testtable"', 'public."testtable"'
)
)