Alembic says target database is not up to date.

7,720 views
Skip to first unread message

John Anderson

unread,
Apr 5, 2012, 3:00:55 PM4/5/12
to sqlal...@googlegroups.com
I'm wondering how alembic decides if a database is "out of date" or not, I was trying to use it to autogenerate a new migration but it kept saying my database was out of date even though it wasn't.

I hadn't ever ran a migration script on the database, it was an autogenerated one using create_all() from sqlalchemy rather than my production database where I run all the revisions.

I made the versions/ folder and it was able to generate the migration script properly.

Michael Bayer

unread,
Apr 5, 2012, 3:29:34 PM4/5/12
to sqlal...@googlegroups.com
it selects the number from the table "alembic_version", compares it to the highest numbered script in your migrations/versions/ directory.

if you used create_all(), then you need to stamp the version. See the docs for this specific use at http://readthedocs.org/docs/alembic/en/latest/tutorial.html#building-an-up-to-date-database-from-scratch .

> --
> You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
> To post to this group, send email to sqlal...@googlegroups.com.
> To unsubscribe from this group, send email to sqlalchemy+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.

Reply all
Reply to author
Forward
0 new messages