SQLite batch migrations: missing operations for index #287
Migrated issue, originally created by Thomas Tanner (@ttanner)
I'm trying to use batch migrations with SQLite.
In env.py I have added render_as_batch=True and set the metadata
alembic revision --autogenerate creates:
Then "alembic upgrade head" fails with:
"alembic upgrade head --sql" fails with:
sqlalchemy 0.9.9, alembic 0.7.5post2, Python 2.7.9
The text was updated successfully, but these errors were encountered:
Michael Bayer (@zzzeek) wrote:
what's unusual here is that the "create index" is in the batch context at all. SQLite supports CREATE INDEX and DROP INDEX. moving it out of "batch" would resolve. Though it looks like in source code that index moves were intended to be within the batch for that table in any case, and the method is just named incorrectly. which means the bug is that a test wasn't added for this.