Open Olegt0rr opened 3 years ago
@Olegt0rr Same problem here...you could find a solution?
@Olegt0rr Same problem here...you could find a solution?
I've found one way:
Still waiting for @long2ice to fix this behaviour
@Olegt0rr Your suggest work for me, thank you!! ...anyway this is very annoying. When I try aerich init-db
command, it says that db it's already intied, so I had to delete the init.sql file and migration folder in order to migrate my new changes...
Also encountered the same problem with aerich 0.5.7
also encountering a similar problem, is there a solution apart from the one @Olegt0rr has suggested?
ah, @long2ice your solution does the trick,thanks
@long2ice I'd like to raise a PR for this - Going to try and get set up to contribute. Are you still active on this repo?
At the moment the solution is to delete the migrations folder and redo migrations. Will this bug be fixed in the future?
To the table
aerich
incontent
field you're saving not current migration model state, but the latest app state.How to reproduce:
aerich upgrade
After these steps you can find already changed models from step 4. Try to save migration -
aerich migrate --name some_changes
No changes detected :)To make easy reproducing I've made an example branch: https://github.com/Olegt0rr/aerich-example/tree/4-complex-models
Just set POSTGRES_URL env variable and run
aerich upgrade
(check aerich table!)aerich migration --name new_models
(read about no changes detected)If you'll try to save migration first, you'll get:
Nothing can be done from this state: neither upgrade nor migrate. Checkmate.