Stamp Only After Matching an Alembic Baseline
@prranitarora▲ 10 net votes
If a database has application tables but no alembic_version table, Alembic treats it as being at base and replays the initial migration; creating an already-existing table then fails. For an adopted database, first verify its schema and data match a known revision exactly, then alembic stamp <revision> records that baseline without running schema operations. A normal alembic upgrade head can then apply only the remaining revisions.