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

--force doesn't work in model:generate #690

Closed
AtomicVar opened this issue Aug 29, 2018 · 2 comments
Closed

--force doesn't work in model:generate #690

AtomicVar opened this issue Aug 29, 2018 · 2 comments

Comments

@AtomicVar
Copy link
Contributor

What you are doing?

I have tried to put --force in every possible position like:

$ npx sequelize model:generate --force --name User --attributes email:string,name:string,password:string,salt:string,portrait:string
$ npx sequelize model:generate --name User --force --attributes email:string,name:string,password:string,salt:string,portrait:string
$ npx sequelize model:generate --name User --attributes email:string,name:string,password:string,salt:string,portrait:string --force
$ npx sequelize --force model:generate --name User --attributes email:string,name:string,password:string,salt:string,portrait:string

What do you expect to happen?

I wanted that I could generate a model by force.

What is actually happening?

But it still claimed that

ERROR: The file /home/guo/git-repos/artnew/models/user.js already exists. Run command with --force to overwrite it.

Dialect: mysql
Database version: 5.7
Sequelize CLI version: 4.1.1
Sequelize version: 4.38.0

@sushantdhiman
Copy link
Contributor

This was fixed for model:create #680

Are your sure you are using latest cli version OR try model:create

@AtomicVar
Copy link
Contributor Author

AtomicVar commented Aug 31, 2018

@sushantdhiman I finally figured it out and make a PR #691 because only one line of code need to be changed.

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

2 participants