Django migrations are not applied to postgres database

I followed the following documentation

My app has deployed fine however when I push changes that require me to run python makemigrations and python migrate I see the following…

after makemigrations i see the changes migrations being made

but when I run migrations it says there are no migrations…

Basically the posgres database does not update and I have to delete the database after every migration…

Submit an answer
Answer a question...

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
April 16, 2022


Do you have an additional App component for running your Django migration?

You could add the following to your app yaml file:

- name: migrate
  kind: PRE_DEPLOY
    repo: digitalocean/sample-django
    branch: static
    deploy_on_push: true
  run_command: python migrate
    value: "1"
    scope: BUILD_TIME
    value: "${db.DATABASE_URL}"
    scope: RUN_TIME

For a reference, here is an example yaml file that contains all of the required components:

Let me know how it goes!