Currently, my evolutions are used in two ways (in a Play!2 app):
- They are used to define the structure of the database
- They are used to populate the database with some default values.
The Downs usually destroy whatever changes Ups may have done. I haven't used the evolutions in prod mode, but I understand that they are applied on startup of the app.
Does that mean that updating the app will cause the evolutions to be reapplied, thus cause me to lose all my data? If so, how can I avoid this?
preguntado el 28 de agosto de 12 a las 14:08
If you enable Evolutions in Production mode, the Downs part of your script will not be executed. For that you need to disable automatic generation of Evolution files by deleting the first 2 commented lines of the conf/evolutions/default/1.sql:
# --- Created by Ebean DDL # To stop Ebean DDL generation, remove this comment and start using Evolutions # --- !Ups ...
You can also take a look at this question for more details: ¡Jugar! framework - problema de la base de datos con Evolutions