Play! framework - database issue with Evolutions

前端 未结 4 969
深忆病人
深忆病人 2021-02-01 09:53

I\'m using Play! framework 2.0 and I\'m stuck on an annoying issue involving the database.

Suppose I have a User (extends Model) class which ha

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-01 10:06

    What you are probably doing is applying destructive evolutions. If you look in 1.sql (or whatever your evolutions file is), under DOWNS you have statemtnts like "DROP DATABASE X". Whenever Play detects changes in the evolution file, it runs all the down evolutions, then reapplies the up evolutions, resulting in all your data being lost.

    Here is more info: http://www.playframework.org/documentation/2.0.2/Evolutions

提交回复
热议问题