回退进化 [英] Rolling an evolution back

查看:105
本文介绍了回退进化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题似乎很愚蠢,但是我找不到任何有关如何回滚Play 2.0演进的说明. Google仅找到说该文件使用了演化文件的"Downs"部分的页面,仅此而已.任何指针或指令,将不胜感激.

This question might seem stupid, but I cannot find any instruction on how to roll back an evolution in Play 2.0. Google only finds pages which say that the "Downs" section of an evolution file is used for that and that's all. Any pointers or instructions will be appreciated.

推荐答案

Downs 部分主要用于在脚本更改后还原Evolution.也就是说,您有一个将 2.sql 应用于数据库的项目,然后由于合并,在源中修改了 2.sql . Play将在旧版本上运行 Downs ,然后在新的2.sql上运行 Ups ,以确保数据库与代码库同步.

The Downs part is mainly used to revert an Evolution when the script has changed. That is, you have a project with 2.sql applied to the database and then, due to a merge, 2.sql is modified in the source. Play will run Downs on the old version and then Ups on the new 2.sql to ensure the database is in sync with the codebase.

据我所知,无法单独触发 Down ,因为Evolution的目的是准备数据库以处理您的代码,并且仅应用一个 Downs 步骤将使应用程序处于不一致状态,并引发许多潜在的错误.

As far as I know there is no way to trigger Downs by itself, as the purpose of an Evolution is to prepare the database to work with your code, and applying just one Downs step would leave the application in an inconsistent state with many potential errors arising.

如果您确实需要还原某些内容,那将是一个新的Evolution(3.sql),其中 Ups 将进行所需的更改.

If you really need to revert something, that would be a new Evolution (3.sql) where Ups would do the changes required.

这篇关于回退进化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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