Evgeniy Khramkov
Evgeniy Khramkov

Reputation: 160

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

I'm using two connections in sails app: mongodb and postgresql. For mongodb i want to use "alter" strategy, but postgres db must be readonly. Is there any way to achieve this?

Upvotes: 1

Views: 219

Answers (1)

Alexis N-o
Alexis N-o

Reputation: 3993

You cannot define it at the connection level, but you can override the configuration for the models of your choice.

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

Upvotes: 4

Related Questions