Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrations fail during deployment #159

Closed
gpelouze opened this issue Oct 9, 2023 · 1 comment · Fixed by #160
Closed

Migrations fail during deployment #159

gpelouze opened this issue Oct 9, 2023 · 1 comment · Fixed by #160
Assignees
Labels
bug Something isn't working

Comments

@gpelouze
Copy link
Member

gpelouze commented Oct 9, 2023

When deploying v1.0.6-beta, we get:

django.db.migrations.exceptions.InconsistentMigrationHistory: Migration data_products.0001_initial is applied before its dependency virtual_labs.0005_virtuallabinstance on database 'default'.

@gpelouze
Copy link
Member Author

gpelouze commented Oct 9, 2023

This is because we didn’t commit migration files, as recommended in the django doc:

The migration files for each app live in a “migrations” directory inside of that app, and are designed to be committed to, and distributed as part of, its codebase. You should be making them once on your development machine and then running the same migrations on your colleagues’ machines, your staging machines, and eventually your production machines.

As such, we should remove the makemigrations commands from the docker images, and run them locally so that they can be committed.

@gpelouze gpelouze changed the title Migrations on deployment Migrations fail during deployment Oct 9, 2023
@gpelouze gpelouze added the bug Something isn't working label Oct 9, 2023
@gpelouze gpelouze self-assigned this Oct 9, 2023
@gpelouze gpelouze linked a pull request Oct 10, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant