gpt4 book ai didi

mysql - 在项目数据库中创建模型期间 Sequelize CLI 错误

转载 作者:行者123 更新时间:2023-12-03 22:31:34 25 4
gpt4 key购买 nike

我在通过 MySQL 数据库中的 sequelize 创建模型时收到一条消息。
它显示一条消息 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
请帮我解决这个消息。

最佳答案

您拼错了 --attributes 表示 --attribute 。尝试运行这个:

sequelize model:create --name Category --attributes 'name:string' --force

关于mysql - 在项目数据库中创建模型期间 Sequelize CLI 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66462925/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com