Hey!

What approach would you recommend if we want to run some revisions outside 
of a transaction, but then run the other ones normally?

Let me illustrate that. Let's say we have revisions 1,2,3,4,5. The database 
is currently at revision 1, so we need to run 2-5. The problem is that 4 is 
an operation that can't be in a transation, specifically CREATE INDEX 
CONCURRENTLY from Postgres (synchronous creation of the index would block 
writes to a table, which is unacceptable in production).
So we'd like to run, 2 and 3 in a transaction, then do 4 outside of a 
transactionand wait for it, then run 5 in a transaction.

In run_migrations_online (we don't use offline) there's this bit
with sql_engine.connect() as connection:
    with context.begin_transaction():
        context.run_migrations()

Can we get access to the list of revisions here and bundle them up however 
we want?

Best regards,
Michał Bultrowicz

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy-alembic+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to