feat: add --forceActions option to current#255
Merged
Conversation
This reverts commit 360599a.
5 tasks
benjie
commented
Apr 22, 2026
Comment on lines
-77
to
+88
| // 4: if different | ||
| if (!migrationsAreEquivalent) { | ||
| // 3a: Run actions if the migrations are different OR if forced. | ||
| if (forceActions || !migrationsAreEquivalent) { | ||
| await executeActions( | ||
| parsedSettings, | ||
| shadow, | ||
| parsedSettings.beforeCurrent, | ||
| ); | ||
| } | ||
|
|
||
| // 4: if different | ||
| if (!migrationsAreEquivalent) { |
Member
Author
There was a problem hiding this comment.
@maxkorp This is different to your previous logic - the actions are now ran independently of the database changes themselves being implemented. Is this desired? I think it effectively makes little difference since we're in a transaction so the changes aren't visible anyway...
benjie
commented
Apr 22, 2026
| const interval = process.hrtime(start); | ||
| const duration = interval[0] * 1e3 + interval[1] * 1e-6; | ||
| if (!migrationsAreEquivalent) { | ||
| if (forceActions || !migrationsAreEquivalent) { |
Member
Author
There was a problem hiding this comment.
@maxkorp unless I messed up all the merges, I think you omitted this change previously?
Member
Author
|
The thing this is lacking right now is tests. The code looks fine. |
Member
Author
|
Released in |
This file contains hidden or 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
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.
Implements #148; work was primarily done by @maxkorp
Description
This adds the
--forceActionsflag tographile-migrate current, which behaves as it does for themigratecommandPerformance impact
If running
graphile-migrate currentthis will run the actions as specified without any real performance hit (except for the time spent to run the actions, obviously), since it's just an additional or statement against a boolean.Security impact
None that I can think of?
Checklist
yarn lint:fixpasses.yarn testpasses.RELEASE_NOTES.mdfile (if one exists).