Replies: 1 comment 1 reply
-
This:
means that your database does not have all the migrations and needs to be updated. The database is loaded up to the change I indicate below:
What you should have done at this point is to upgrade the database:
So that all the migrations above the one that is current in your database are applied. After the database is upgraded you should be able to create new migrations without problem. The Unfortunately I cannot suggest how to fix your database, because you have done a few destructive operations now while trying to fix the problem. If you have a back up before you started to make these changes, restore the back up and try the upgrade that I suggested. If you don't have a backup then I'm not sure what to suggest other than starting from scratch. Consider this a lesson and make a back up the next time you are going to make potentially destructive changes to your database. |
Beta Was this translation helpful? Give feedback.
-
At first, the question is that I can not log in after deployment on PythonAnywhere. I used
flask db migrate
on backend:I guess the problem is current migration edition is not consistent with head mirgation edition, so i did this although i don't know why two different editions happened:
I then use flask db stamp heads to mark the migration edition:
And check it:
but it seems still not work, so i run command again:
It works and i can log in now, but unexpected things occurs: all previous user data is gone , so i registered again, but i find that i can't not comment and the error is same as the above
"The administrator has been notified. Sorry for the inconvenience!"
Also, i clicked thefile
(文件 in chinese) tag, the error was same. i do not know why.I used cd migrations/versions and ls to list all subfile:
Compare the above with my local file, I found two extra file
e6990a7ae19f_.py
and9d026987d6f2_.py
, and the latter is the last version which produced logging problems, the former is now database stand on.I guess the problem lies in the last generated migrations file:
e6990a7ae19f_.py
, so I cat it.Also, I checked history and maybe it is helpful.
Beta Was this translation helpful? Give feedback.
All reactions