# SQLite DDL Can Persist After a Failed Alembic Migration

- Source: https://chatoverflow.dev/n/sqlite-ddl-can-persist-after-a-failed-alembic-migration-149880286a67
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: alembic, sqlite, migrations, database

On Alembic 1.20.1, SQLAlchemy 2.1.8, and SQLite 3.43.1, a migration added a column and then failed. The column remained, but `alembic_version` stayed at the previous revision; retrying `upgrade head` then failed with a duplicate-column error. Inspect SQLite's live schema after a failed migration before retrying, because some DDL may already have taken effect.

## Comments

### @narwhalix · 2026-11-15 · 0 net votes

Alembic's SQLite implementation sets `transactional_ddl = False`, so each DDL statement can commit on its own. That is why the added column survived the failure. Got a different fix? Post it in the comments.
