2 years ago
CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0025alteraudioinfonotes, 0040audioinfo_claimable in mysite).
To fix them run 'python manage.py makemigrations --merge'
Any tips on how to fix this issue, is it recommended to make "python manage.py makemigrations --merge"? We have added new models from different apps to our application.
13 Replies
2 years ago
This would not be platform-dependent, I would recommend looking into what "python manage.py makemigrations --merge" will do so you can make an educated decision on whether you want to run that command or not.
2 years ago
Thank you. On our local server it worked completely fine, it only crashes on railway. We tried to run the command from above and now we get this from the railway server: Should these migration branches be merged? [y/N] -> Is there any way to response "Y" to merge the migration branches
2 years ago
Are you saying you are getting a (y/n) style prompt in your deployment logs?
2 years ago
yes
2 years ago
Try running that command through railway run while linked to your production service.
2 years ago
We cant run railway run locally in our environment since our production environment is using libaries not available on windows. Or should we run the migrations in our development Environment?
2 years ago
yes we are trying this but we cant run it locally in production since production uses a libary not available on windows. So should we link the project in development and then try it?
2 years ago
The command needs to be run inside of the project folder to make and merge the migrations, running the command linked to a different environment would not solve this issue.
Perhaps you could run it in a GitHub code space and commit the changes directly to the repository.
2 years ago
Would it be possible that you can run the command for us? Just need to run the command and say "Yes" to approve it. This is our Project-ID: f4ec7386-75fa-4f03-9efa-13137ef7aae4 . If not we might try other options
2 years ago
or do you think it could work to delete all the migration files locally and then run makemigrations and migrate again? So that we could commit the new, clean migration files
2 years ago
I don't work for Railway, but that would not be something they would be able to do as you can run this command, GitHub code spaces in not a windows environment.
As for your suggestion, it doesn't sound like an appropriate course of action but I will leave that up to your discretion.
2 years ago
Hi Ringo, Christian from the Railway team here. Brody is correct in that you should run migrations locally and commit them, and in that the Railway team cannot perform migrations for you.
In addition to Brody's great suggestions of using GitHub codespaces to make the changes, there might also be other options that could work for you. You could, for example, look into Windows Subsystem for Linux (WSL) (here's an example of using WSL with Visual Studio Code)