-
-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flask db migrate/upgrade not responding #384
Comments
Can you provide an example project that has this problem? I can't really tell you what's wrong, something is definitely missing but I don't know exactly what. |
@miguelgrinberg, I can reproduce this issue with Steps to reproduce: > pip install flask-migrate==2.6.0
> flask db upgrade
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
INFO [alembic.runtime.migration] Running upgrade xxx -> yyy
> rm migrations/yyy.py
> flask db upgrade
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
# NO ERROR RETURNED HERE
> pip install flask-migrate==2.5.3
> flask db upgrade
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
ERROR [root] Error: Can't locate revision identified by 'yyy' |
Why would you want to use an old release through? Old releases have to be installed from a requirements.txt file, because the dependencies might have changed since the release. In particular Alembic has been upgraded in a backwards incompatible way in this case. |
I would not want to use an old release. I just noticed this after updating to |
I think you have a misunderstanding related to how Alembic works. When you run So when you do this:
The fact that you deleted a migration does not change anything. Your models and your database are still matching so there is nothing to do and for that reason Alembic just returns without doing anything. You will definitely have issues when you try to migrate the database again, because that migration script that you deleted introduced an inconsistency in your migration repository. |
I'm definitely not expecting for the operation to be successful. I'm just expecting for an error message to be displayed. The cause of the issue seems to be this commit: 4887bd5 flask-migrate doesn't use the root logger anymore, so |
Okay, you should have started by explaining the problem, I do understand now. This is now fixed in the master branch. |
Thanks for the update, that helped me to track down my problem as well! |
Sorry, I couldn't create an example code for testing. But I think the problem(not showing error message) is related to the
So, I guess I caused that just by messing with the migrations folder. |
You just need to import models in the init.py file of package |
Hi, I deleted the migrations folder, then ran
flask db init
, thenflask db migrate -m 'Test'
, but nothing happened, only got some messages:The command
flask db upgrade
also shows the same message but nothing else.The text was updated successfully, but these errors were encountered: