Skip to content

Commit

Permalink
docs: mention autocommit_block as a solution for Aborted transaction …
Browse files Browse the repository at this point in the history
…error during migration

Closes #229
  • Loading branch information
IlyaFaer authored Aug 30, 2022
1 parent 78582fe commit a36ab60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ primary key:
As Spanner restricts changing a primary key value, not setting the ``version_table_pk`` flag
to ``False`` can cause migration problems. If ``alembic_versions`` table was already created with a primary key, setting the flag to ``False`` will not work, because the flag is only applied on table creation.

Also notice that DDL statements in Spanner are not transactional and will not be automatically reverted in case of a migration fail.
Notice that DDL statements in Spanner are not transactional. They will not be automatically reverted in case of a migration fail. Also Spanner encourage use of the `autocommit_block() <https://alembic.sqlalchemy.org/en/latest/api/runtime.html#alembic.runtime.migration.MigrationContext.autocommit_block>`__ for migrations in order to prevent DDLs from aborting migration transactions with schema modifications.

| **Warning!**
| A migration script can produce a lot of DDL statements. If each of the
Expand Down

0 comments on commit a36ab60

Please sign in to comment.