在迁移到sails 1.0时,当我执行以下操作时出现此错误sails lift
-
Error: Consistency violation: Instantiated Waterline model already has a `datastore` property
我的配置 -
// config/datastores.js
module.exports.datastores = {
default : {
mySQL: {
adapter: 'sails-mysql',
url: 'mysql://username@localhost:3306/my_db'
}
}
}
// config/models.js
module.exports.models = {
datastore: 'mySQL',
migrate: 'drop',
attributes: {
// timezone-agnostic ISO 8601 JSON timestamp strings (e.g. '2017-12-30T12:51:10Z')
createdAt: { type: 'string', autoCreatedAt: true, },
updatedAt: { type: 'string', autoUpdatedAt: true, }
}
};
// config/env/development.js
datastores: {
mySQL: {
adapter: 'sails-mysql',
url: 'mysql://username@localhost:3306/my_db'
}
}