Open jordanh opened 8 years ago
Thanks for the PR. Unfortunately I cannot merge it since it would break existing functionality. It would mean all existing users (including me) would have to update their build scripts to add the --all
flag.
Since the default behaviour in a build environment is to run all up migrations, the flag really shouldn't have to be added there. On the other hand running migrate down
on one, failed migration in the build environment is inadequate as well.
What I think is the correct solution is this:
rethink-migrate up
runs all outstanding up migrationsrethink-migrate up
fails, it automatically rolls back all completed up migrationsrethink-migrate up --one
runs only one up migration - this is primarily for testing locallyrethink-migrate down
runs all down migrationsrethink-migrate down
fails, no action needs to be taken since it's a recoverable failurerethink-migrate down --one
runs only one down migration - this is primarily for testing locallyWhat do you think?
If you agree with this idea, I (or you if you want 😄 ) can start by adding a --one
flag so that one up migration can be run.
Sure. That sounds just peachy. 🍑
I implemented the easy part of this: --all
or --one
without rollback. If you like it, it can serve as a starting point for the more robust version.
@JohanObrink I like your decision. Is there any progress on this issue?
@xfg - I think think this is ready to merge. After merging, we should create a new issue to later enhance rethink-migrate
to apply migrations atomically. That was a good suggestion from @JohanObrink.
After reading
README.md
I'm not sure if this feature was intentionally omitted or not. But, we'd like it.Closes #26.