简体   繁体   中英

How to migrate models in production mode with SailsJS and MongoDB

I developed a web application with the MVC SailsJS (Version 1.1.0) framework, based on node js. I released it in production mode but every time I release an update from development to production I don't know how to do that.

This, because in development I can execute the sails lift -alter command that independently modifies the models and adapts them to new modifications, but in production this command is blocked.

What is the best way to take? Should I create scripts in MongoDB where I manually change the collections?

As I've readed in StackOverflow and other sites including Sails official documentation you have to edit your database by hand to addapt to your new model changes given:

"All of your models' migration settings are forced to migrate: 'safe' . This is a failsafe to protect against inadvertently damaging your production data during deployment." from here in Sails Official Documentation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM