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: ordering of tasks is incorrect! #6972

Closed
ErisDS opened this issue Jun 11, 2016 · 0 comments · Fixed by #7000
Closed

Migrations: ordering of tasks is incorrect! #6972

ErisDS opened this issue Jun 11, 2016 · 0 comments · Fixed by #7000
Assignees
Labels
bug [triage] something behaving unexpectedly help wanted [triage] Ideal issues for contributors to help with
Milestone

Comments

@ErisDS
Copy link
Member

ErisDS commented Jun 11, 2016

As we add more and more migrations to Ghost, it has become clear that we're not doing migrations in the correct order.

If you upgrade from an old blog running on data version 003, you'll get the migrations in the following order:

  • 004 schema migration
  • 005 schema migration
  • 006 schema migration
  • 004 fixture migration
  • 005 fixture migration
  • 006 fixture migration

There isn't a case (as far as I know) where this will break at the moment, but if we ever remove or rename a column for which there is an old migration, the migrations will fail because the change to the column in the new migration will happen before the fixture migration runs.

To be correct, the migrations should happen in this order:

  • 004 schema migration
  • 004 fixture migration
  • 005 schema migration
  • 005 fixture migration
  • 006 schema migration
  • 006 fixture migration
@ErisDS ErisDS added bug [triage] something behaving unexpectedly data help wanted [triage] Ideal issues for contributors to help with labels Jun 11, 2016
@kirrg001 kirrg001 mentioned this issue Jun 16, 2016
6 tasks
@kevinansfield kevinansfield added this to the 0.9.0 milestone Jun 20, 2016
kirrg001 added a commit to kirrg001/Ghost that referenced this issue Jun 20, 2016
closes TryGhost#6972, TryGhost#6574

- run each database version as top level transaction
- run migrations in correct order
ErisDS pushed a commit that referenced this issue Jul 14, 2016
closes #6972, #6574

- run each database version as top level transaction
- run migrations in correct order
chris-brown pushed a commit to chris-brown/Ghost that referenced this issue Aug 14, 2016
closes TryGhost#6972, TryGhost#6574

- run each database version as top level transaction
- run migrations in correct order
geekhuyang pushed a commit to geekhuyang/Ghost that referenced this issue Nov 20, 2016
closes TryGhost#6972, TryGhost#6574

- run each database version as top level transaction
- run migrations in correct order
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [triage] something behaving unexpectedly help wanted [triage] Ideal issues for contributors to help with
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants