停止sails.js中架构的自动迁移 [英] Stop the auto migration of the schema in the sails.js

查看:91
本文介绍了停止sails.js中架构的自动迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

sails.js 中,我们如何停止将架构自动迁移到数据库中。有时,它会因迁移而产生错误。有没有办法只在部署应用程序时才能运行迁移?

In sails.js, how can we stop the automigration of the schema into the database. Sometimes,it gives error due to the migration. Is there a way that we can make the migration run only when the application is deployed?

推荐答案

你也可以尝试这样的事情:

You can also try something like this:

module.exports = {

  // migrate: 'alter', // adds and/or removes columns on changes to the schema 

  // migrate: 'drop', // drops all your tables and then re-creates them. All data is deleted.

  // migrate: 'safe', doesn't do anything on sails lift- for use in production.

  attributes: { /* ... */ }

};

这篇关于停止sails.js中架构的自动迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆