Skip to content
Hennie Brink edited this page May 15, 2016 · 1 revision

By default the ORM will just recreate your database when the version is increased. To prevent this and run upgrade script instead you will you can do the following.

  1. Place your upgrade scripts in the android assets folder under a directory of your choice.
  2. Specify the directory in your CPOrmConfiguration class. so if the directory is assets/my.upgrade.scripts you will have to return my.upgrade.scripts
  3. Each file in the directory must start with the version number the script applies to. So for instance if upgrading to version 14, the file name can be 14_Added_Favorites_Table.sql
  4. The contents of the file will be executed by the database directly, so be sure to separate your statements with ;

Clone this wiki locally