sails.js 中的多个数据库连接,每个连接都有迁移设置

Multiple db connections in sails.js with migration setting per connection

我在 sails 应用程序中使用两个连接:mongodb 和 postgresql。对于 mongodb 我想使用 "alter" 策略,但是 postgres 数据库必须是只读的。有什么办法可以实现吗?

您不能在连接级别定义它,但是you can override the configuration for the models of your choice

// in api/models/PosgresModel.js
module.exports = {
  migrate: 'safe',
  attributes: {
    // The attributes definitions
  }
}