I'm trying to figure out how to disable automatic database migrations for Models in Sails.js.
I know you can set migrate: 'safe'
in the model, but is there a way to specify this for all models?
I'm trying to figure out how to disable automatic database migrations for Models in Sails.js.
I know you can set migrate: 'safe'
in the model, but is there a way to specify this for all models?
Actually, there is a way to do it. ORM hooks are getting defaults from
sails.config.model
, so all you have to do is to createconfig/model.js
with the following content:After this the migrations won't be running upon
sails lift
, but they will still be applied once you create a document, for example.