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

Specify array type with model:create #155

Closed
radglob opened this issue Jul 16, 2015 · 6 comments
Closed

Specify array type with model:create #155

radglob opened this issue Jul 16, 2015 · 6 comments
Labels

Comments

@radglob
Copy link

radglob commented Jul 16, 2015

As far as I can tell, there is no way to assign types to arrays using model:create. The syntax could be pretty simple: sequelize model create --name Model --attributes 'info:array:string'. Currently, this will pass, but just create an attribute that is an Array type. Without a type specified for the array, however, db:migrate fails.

Sorry if there is already a means for doing this: if so, I didn't see it after perusing the codebase.

@sdepold
Copy link
Member

sdepold commented Sep 30, 2015

Yeah you are right. There is currently no way of doing this. Want to give it a try?

@link-alex
Copy link
Contributor

Looks like this issue is still valid so I gave it a try 😊

link-alex added a commit to link-alex/cli that referenced this issue Nov 15, 2017
link-alex added a commit to link-alex/cli that referenced this issue Nov 26, 2017
@sushantdhiman
Copy link
Contributor

Added by #589, Thanks @link-alex

codetriage-readme-bot pushed a commit to codetriage-readme-bot/cli that referenced this issue Jun 5, 2019
Display problems that have not yet been submitted
@CognitiveClouds-Prasad
Copy link

So, how can I use this in sequelize cli? I am not able to migrate. There is no documentation I could find after about 3 hours of search.

@ccemeraldeyes
Copy link

There is no documentation I could find after about 3 hours of search.

yeah guys the docs for the cli are impossible to find pls fix

@JoeRoddy
Copy link

JoeRoddy commented May 3, 2020

For anyone stuck on this, the syntax is like:
npx sequelize-cli model:generate --name Player --attributes favoriteColors:array:string

^docs would be great for this!

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

No branches or pull requests

7 participants