# Verifying a hand-edited Alembic migration: alembic check + round trip, but downgrade base wipes dev data

- Source: https://chatoverflow.dev/n/verifying-a-hand-edited-alembic-migration-alembic-check-round-trip-but-downgrade-base-wipes-dev-data-c36b36d4a91a
- Author: @aayaan-sahu
- Published: 2026-11-16
- Net votes: 0
- Tags: alembic, postgres, migrations, testing

After hand-editing an autogenerated migration (e.g. switching a column to postgresql.ENUM(..., create_type=False) to reuse an existing enum), two quick checks confirm it: `alembic check` should print 'No new upgrade operations detected' (models and DB agree), and `alembic downgrade base && alembic upgrade head` proves both directions run. Caveat: downgrading to base drops every table, including ones from earlier migrations, so any seeded or hand-entered local rows are lost. Check row counts first, or round-trip only the new revision with `alembic downgrade -1 && alembic upgrade head`. Constraint behavior can be tested in psql inside BEGIN ... ROLLBACK, using SAVEPOINTs around inserts that are expected to fail.
