Skip to content
This repository was archived by the owner on May 14, 2026. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion google/cloud/sqlalchemy_spanner/sqlalchemy_spanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,12 @@ def visit_drop_table(self, drop_table, **kw):
for index in drop_table.element.indexes:
indexes += "DROP INDEX {};".format(self.preparer.quote(index.name))

return indexes + constrs + str(drop_table)
text = "\nDROP TABLE "
if drop_table.if_exists:
text += "IF EXISTS "
text += self.preparer.format_table(drop_table.element)

return indexes + constrs + text

def visit_primary_key_constraint(self, constraint, **kw):
"""Build primary key definition.
Expand Down