-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
feat: add --forceActions option to watch #148
base: main
Are you sure you want to change the base?
Conversation
I'm not super happy with the way that this would also force the migration to run in watch mode even if there's no changes; but equally I'm not happy with only running the actions because there might be an action that assumes that the migration has ran freshly (e.g. dropped and recreated a table)... I wonder if maybe we should add a |
Yeah I didn't love that either. The only time i'd see it being advantageous is testing changes to your dumping script. What if
|
That seems reasonable, but I'm concerned someone will come up with a use case for running the actions every time and I'm not sure what we'd then expose that as... How about we add |
I like that idea! How about |
I think |
Working on this now, would love to talk about what I imagine like so? (Please forgive my comical verbosity here) Committed Migrations are run, no changes to current, no force
Committed Migrations are run, no changes to current, forceActions passed
Committed Migrations are run, changes to current, no force
Committed Migrations are run, changes to current, forceActions passed
Committed Migrations are not run, no changes to current, no forceIs this state possible? or does it always run current if it ran some committed migrations, even if it's empty? Like in the case of
Committed Migrations are not run, no changes to current, forceActionsPassedSee above question
Committed Migrations are not run, changes to current, no forceAlso Committed Migrations are not run, changes to current, forceActionsPassedThese are the same since the actions are run anyways, yes?
Like, this is the fully broken out tree. Obviously we can simplify this down a bit, I just want to be super explicit about which cases I'm not sure about. If I was going to pitch an |
Side note, I'll squish this down once we're ready with it, I just want to maintain what I've done while still working on it. |
Also, I'm not 100% sure that I love that we pull the "running current script" code from watch into current. Perhaps that belongs in current, and watch pulls it in (basically just reversing the direction on that import/export. |
Description
This adds the
--forceActions
flag to watch, which behaves as it does for the migrate commandPerformance impact
If running
graphile-migrate watch --once
this 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.TBD: Without the
--once
I am pretty sure this will run every time you save, perhaps that is desired but it seems potentially unwanted.Security impact
None that I can think of?
Checklist
yarn lint:fix
passes.yarn test
passes.RELEASE_NOTES.md
file (if one exists).