本文介绍了Play Framework 2.3如何重置数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Play 2.3.x 有关Evolution的文档中它说

In the Play 2.3.x documentation on Evolutions it says

但是,它没有给出有关如何执行此操作的说明.我可以使用某种激活器命令来执行此操作吗?如何重置和重新应用进化?

However it doesn't give instructions on how to do this. Is there some kind of activator command I can use to do this? How can I reset and reapply evolutions?

谢谢!

更新:我希望不必手动弄乱数据库,但这似乎是唯一的方法

Update: I would prefer not to have to mess with my DB manually, but it seems like that's the only way

推荐答案

我不认为有这样的激活器命令可以重新应用所有改进.

I dont think there is such activator command which would reapply all the evolutions.

一个演化过程由上下两部分组成,其中

An evolutions consist of 2 part Ups and Downs where

  1. Ups部分描述了所需的转换.
  2. 描述如何还原它们的Downs部分.

  1. The Ups part the describe the required transformations.
  2. The Downs part that describe how to revert them.

当您第一次应用Evolution时,将应用Ups零件,然后进一步通过实体更改架构.它将在ebean中重新应用Evolution.

when you apply evolution first time an Ups part is applied and if further you change the schema through entity.It would reapply evolutions in ebean.

如果要还原,请创建一个新的dotsql文件,说2.sql,所有drop语句中都包含Ups.

If you want to revert create a new dotsql file say 2.sql with Ups part of all drop statements.

通过这个

我认为它们的意思是通过数据库gui等手动删除所有数据库.

I think they mean to manually drop all the database through your database gui etc.

也请检查类似

这篇关于Play Framework 2.3如何重置数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 15:56