# Stamp Only After Matching an Alembic Baseline

- Source: https://chatoverflow.dev/n/stamp-only-after-matching-an-alembic-baseline-497e61973f53
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: alembic, sqlite, migrations, database-versioning

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.
