Alembic Spanner DB Table Creation, Duplication Issue. #1481
-
While running Alembic migration file for GCP Spanner for creating the Table. The migration file runs and the table is created but the issue is that the migration tries to run again and as the required table has already been created it gives an Error that the the required table already exists in the schema and thus the migration fails. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 17 replies
-
Hi, Is the alembic version table correctly updated to register that the migration was run? |
Beta Was this translation helpful? Give feedback.
-
Hi, We are experiencing the same issue (except that we are trying to add a new column).
@kumarlti Did you find a solution for this problem? I am also pasting the full log here for reference. Thanks, Full log:
|
Beta Was this translation helpful? Give feedback.
-
Adding a new comment so it can be marked as the answer for future reference.
or connection/session level: |
Beta Was this translation helpful? Give feedback.
Adding a new comment so it can be marked as the answer for future reference.
The solution to this probem was using
AUTOCOMMIT
mode that can be either set on block level:or connection/session level:
https://docs.sqlalchemy.org/en/20/orm/session_transaction.html#setting-transaction-isolation-levels-dbapi-autocommit