Flask-migrate: Datetime in filename migration

Created on 28 Mar 2016  路  2Comments  路  Source: miguelgrinberg/Flask-Migrate

I cant figure out which migration is next.
image

Can you say chains of the migrations ? i'm not. i need python manage.py db history and match each file. Also i cant figure out if other developer added table with migration in other branch, and also i added new table. How resolve this conflict ?

invalid

Most helpful comment

@bekerov in alembic.ini,

[alembic]
file_template = %%(year)d_%%(month).2d%%(day).2d%%(hour).2d%%(minute).2d%%(second).2d_%%(rev)s_%%(slug)s

All 2 comments

I have no control over this, this is done by Alembic, which is the migration engine for SQLAlchemy. But in any case, the output from manage.py db history should give you the order, and any branches that exist.

You can also implement a pre-commit check on your source control that prevents someone to commit a migration history with conflicts.

@bekerov in alembic.ini,

[alembic]
file_template = %%(year)d_%%(month).2d%%(day).2d%%(hour).2d%%(minute).2d%%(second).2d_%%(rev)s_%%(slug)s
Was this page helpful?
0 / 5 - 0 ratings