我们一直在sailsJS 0.12上运行一个应用程序 - 一旦1.0发布,就会通过升级过程并升级
以前,有些模型支持“数组”类型,不再支持它。有什么替代方案?它不在示例应用程序或文档中
我的模特是:
module.exports = {
attributes: {
provider: 'string',
uid: 'string',
email: 'string',
name: 'string',
firstName: 'string',
lastName: 'string',
password: 'string',
projects: {
collection: 'project',
via: 'owner'
},
creditsHistory:{
collection: 'creditsHistory',
via: 'owner'
},
userRoles: {type: 'array', defaultsTo : [roles.USER]}
},
帆支持的类型1.0是:https://sailsjs.com/documentation/concepts/models-and-orm/attributes
没有任何示例或样本可以用sails 0.12支持的类型替换数组类型:https://0.12.sailsjs.com/documentation/concepts/models-and-orm/attributes
有没有人对此有任何想法?
你可以像这样使用它:
'coordinate': {
'type': 'json',
'required': true,
},
或者您可以像这样使用它:
'cost_price': {
'type': 'ref',
'columnType': "double"
},
在colunmType
中,您可以定义数据库列类型