Skip to content
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

migrate up foo migrates all the way up #156

Open
hdon opened this issue May 21, 2019 · 3 comments
Open

migrate up foo migrates all the way up #156

hdon opened this issue May 21, 2019 · 3 comments

Comments

@hdon
Copy link

hdon commented May 21, 2019

If you name the migration you want to migrate up to, but it doesn't exist, migrate up foo will migrate all the way up:

hdon@ubuntu-s-1vcpu-1gb-sfo2-01:~$ mkdir migrate-project
hdon@ubuntu-s-1vcpu-1gb-sfo2-01:~$ cd migrate-project/
hdon@ubuntu-s-1vcpu-1gb-sfo2-01:~/migrate-project$ npm i migrate
npm WARN saveError ENOENT: no such file or directory, open '/home/hdon/migrate-project/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/hdon/migrate-project/package.json'
npm WARN migrate-project No description
npm WARN migrate-project No repository field.
npm WARN migrate-project No README data
npm WARN migrate-project No license field.

+ [email protected]
added 20 packages from 13 contributors and audited 21 packages in 0.884s
found 0 vulnerabilities

hdon@ubuntu-s-1vcpu-1gb-sfo2-01:~/migrate-project$ ./node_modules/.bin/migrate init
  migrations dir : /home/hdon/migrate-project/migrations
hdon@ubuntu-s-1vcpu-1gb-sfo2-01:~/migrate-project$ ./node_modules/.bin/migrate create a
  create : /home/hdon/migrate-project/migrations/1558410539360-a.js
hdon@ubuntu-s-1vcpu-1gb-sfo2-01:~/migrate-project$ ./node_modules/.bin/migrate create a
  create : /home/hdon/migrate-project/migrations/1558410540833-a.js
hdon@ubuntu-s-1vcpu-1gb-sfo2-01:~/migrate-project$ ./node_modules/.bin/migrate create a
  create : /home/hdon/migrate-project/migrations/1558410546618-a.js
hdon@ubuntu-s-1vcpu-1gb-sfo2-01:~/migrate-project$ ./node_modules/.bin/migrate up b
  up : 1558410539360-a.js
  up : 1558410540833-a.js
  up : 1558410546618-a.js
  migration : complete
hdon@ubuntu-s-1vcpu-1gb-sfo2-01:~/migrate-project$ node --version
v12.0.0
hdon@ubuntu-s-1vcpu-1gb-sfo2-01:~/migrate-project$ npm --version
6.9.0
@wesleytodd
Copy link
Collaborator

wesleytodd commented May 21, 2019

Interesting, yes it would migrate all the way up. I am not sure what I would expect it to do, but probably not that. First off I feel like it should error an exit, but I would want to think on it a little before we make any decision. If you open a PR to change this behavior it would give a good start to the conversation.

@LinusU
Copy link
Collaborator

LinusU commented May 21, 2019

First off I feel like it should error an exit

My first thought as well 👍

@wesleytodd
Copy link
Collaborator

@hdon, are you planning on opening PRs for these issues you opened?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants