feat(cli): improve the "up" commands --from and --to options
The given values can either be migration names or relative paths to migration files. The given migration must exist to avoid accidentally running migrations that wasn't intended to run.
This commit is contained in:
parent
986456b038
commit
9109238b86
12 changed files with 346 additions and 65 deletions
5
.changeset/plenty-insects-accept.md
Normal file
5
.changeset/plenty-insects-accept.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@emigrate/cli': minor
|
||||
---
|
||||
|
||||
When the `--from` or `--to` CLI options are used the given migration name (or path to migration file) must exist. This is a BREAKING CHANGE from before. The reasoning is that by forcing the migrations to exist you avoid accidentally running migrations you don't intend to, because a simple typo could have the effect that many unwanted migrations is executed so it's better to show an error if that's the case.
|
||||
5
.changeset/tricky-turkeys-refuse.md
Normal file
5
.changeset/tricky-turkeys-refuse.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@emigrate/docs': minor
|
||||
---
|
||||
|
||||
Document the changes to the "up" command's `--from` and `--to` options, specifically that they can take relative file paths and that the given migration must exist.
|
||||
5
.changeset/twelve-hairs-relate.md
Normal file
5
.changeset/twelve-hairs-relate.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@emigrate/cli': minor
|
||||
---
|
||||
|
||||
Add support for passing relative paths to migration files as the `--from` and `--to` CLI options. This is very useful from terminals that support autocomplete for file paths. It also makes it possible to copy the path to a migration file from Emigrate's output and use that as either `--from` and `--to` directly.
|
||||
Loading…
Add table
Add a link
Reference in a new issue