Django migration files overwritten after every deployment

To prevent migration conflicts between different developers, we decided to avoid deploying any migrations files; and rather run makemigrations after deployment.

But every time we deploy, the existing migration files are deleted and a new file is created, leading to a programmingerror

Why is Digital Ocean deleting the existing migration files rather than running a new makemigration and appending the model changes to the existing files? We run python makemigrations && python migrate before the run commands.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
December 28, 2022

Hi there,

You should not make the changes directly on the App Platform as the storage there is Ephemeral meaning that after every deployment any changes that you made directly to the local storage will be lost.

You should make your changes to your GitHub project and those changes will be deployed to your App Platform.

Let me know if you have any questions.



Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up