Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to create ENUM type attribute using sequelize cli

Trying to create a model that has an enum field with certain values using Sequelize CLI.

sequelize model:generate --name user --attributes name:string,login_method:enum('email','google')

Error: bash: syntax error near unexpected token `('

What is the right syntax to do so?

like image 693
r.k Avatar asked Oct 31 '25 06:10

r.k


1 Answers

https://github.com/sequelize/cli/blob/master/docs/FAQ.md

try

npx sequelize-cli model:generate --name user --attributes name:string,login_method:enum:'{email,google}'
like image 70
Yumi Ko Avatar answered Nov 04 '25 05:11

Yumi Ko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!