0

I got a message during creating a model through sequelize in MySQL databse.

It shows a message Missing required argument: attributes

PS C:\Users\user\Downloads\codeways-backend> sequelize model:create --name 
Category --attribute 
'name:string' --force


Sequelize CLI [Node: 15.8.0, CLI: 6.2.0, ORM: 6.5.0]

Options:
--version          Show version number     [boolean]                                                                                     
--help             Show help               [boolean]                                                                                            
--env              The environment to run the command in  [string] [default: 
"development"]                                                     
--config           The path to the config file  [string]                                                                                        
--options-path     The path to a JSON file with additional options [string]                                                                      
--migrations-path  The path to the migrations folder  [string] [default: 
"migrations"]                                                          
--seeders-path     The path to the seeders folder  [string] [default: 
"seeders"]                                                                 
--models-path      The path to the models folder   [string] [default: 
"models"]                                                                  
--url              The database connection string to use. Alternative 
to using --config files                                           [string]  
--debug            When available show various debug information  
[boolean] [default: false]                                                         
--name             Defines the name of the new model  [string] [required]                                                                       
--attributes       A list of attributes   [string] [required]                                                                                   
--force            Forcefully re-creates model with the same name [string]                                                                       
--underscored      Use snake case for the timestamp's attribute names [boolean] [default: false]                                                

Missing required argument: attributes

Please help me out with this message.

Anuj Verma
  • 11
  • 4

1 Answers1

0

You misspelled --attributes indicating --attribute. Try to run this:

sequelize model:create --name Category --attributes 'name:string' --force
Anatoly
  • 20,799
  • 3
  • 28
  • 42