Closed Lythimus closed 8 years ago
We use alembic to do the migrations. Once you have the DB configured, you can downgrade or upgrade the DB with these commands:
alembic upgrade head -> this will do all the migrations to the latest version
alembic downgrade VERSION -> this will do the migration to a give version.
Thus, if you need to upgrade, just run alembic upgrade head and everything should be fine :-)
@Lythimus did you find out what was happening? I have the same problem :(
@mcguegi We actually haven't had to update the model of Pybossa much, so I haven't even needed to create migrations since I posted this. I can't recall what I did, but I do believe I got it working, though I may have had to alter the migration file a bit after it was created.
https://stackoverflow.com/a/45700134/15586166 This might help, its possibly a problem with your env (if I understand your question correctly)
Using the majority of the pybossa default configs, autogenerating a migration file produces a script which will drop all tables. I'd like to be able to autogenerate migrations.
alembic revision --autogenerate
Here is an example of the output during generation: