我有一个loopback4模型,其中我定义了属性类型,必需,它与mysql数据库连接。现在我已经定义为字符串的描述列,并在表中显示varchar(512)。对于描述我有超过512长度。如何改变这一点。如果我在表格中手动更改长度。如果我运行它将被更改为默认值。这该怎么做。
型号代码:
@property({
type: 'string',
required: true,
})
description: string;
我已将类型更改为“文本”,但它会抛出错误。帮助我解决此问题。
尝试使用datalength属性
例如
@property({type:'string',required:true,datalength:1000})description:string;