我在 sails 应用程序中使用两个连接:mongodb 和 postgresql。对于 mongodb 我想使用“alter”策略,但 postgres db 必须是只读的。有什么办法可以实现这一点吗?
最佳答案
您无法在连接级别定义它,但you can override the configuration for the models of your choice .
// in api/models/PosgresModel.js
module.exports = {
migrate: 'safe',
attributes: {
// The attributes definitions
}
}
关于node.js - sails.js 中的多个数据库连接,每个连接具有迁移设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31703853/