-
Notifications
You must be signed in to change notification settings - Fork 7
Upgrade Scripts
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.
- Place your upgrade scripts in the android
assetsfolder under a directory of your choice. - Specify the directory in your CPOrmConfiguration class. so if the directory is
assets/my.upgrade.scriptsyou will have to returnmy.upgrade.scripts - 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 - The contents of the file will be executed by the database directly, so be sure to separate your statements with
;