-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
improvement/migrations #7000
Merged
Merged
improvement/migrations #7000
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d8d8647
to
ea188bf
Compare
closes TryGhost#6972, TryGhost#6574 - run each database version as top level transaction - run migrations in correct order
ea188bf
to
404a207
Compare
}).then(function () { | ||
return fixtures.ensureDefaultSettings(logger); | ||
return models.Settings.populateDefaults(modelOptions); |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
ready to review 👍 |
// @TODO: | ||
// - if you require this file before config file was loaded, | ||
// - then this file is cached and you have no chance to connect to the db anymore | ||
// - bring dynamic into this file (db.connect()) |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
chris-brown
pushed a commit
to chris-brown/Ghost
that referenced
this pull request
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 pull request
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
closes #6972 and #6574
With this PR each database version update happens in a top level transaction.
So if you have a database version of 004 and you need 005 + 006, if 006 fails in any file, we do a rollback and your db is updated to 005.
This PR also fixes the order of executed migrations. (004 schema updates, 004 fixtues)
This PR should be merged together with #7019. #7019 has more improvements and edge cases like that your blog should not start when a migration failed.
TODO
review notes
transaction
as last param, in the future we should only use theoption pattern