Does anyone know the default Path for database that automatic created by Titanium API, when using Alloy model?
The problem that I try to solve is that I add a new property in the model and when I try to save with Alloy model method. It told me that the table does not have that new column.
If I know the path of the database, in upgrade script I can just alter the table to have a new column.
Thank you so much for your help in advance.
I believe the location is the same as the Classic. From the docs:
On iOS, the database file that's created is automatically assigned the .sql extension, while on Android no extension is added.
On iOS 5, database files are stored in the app's Private Documents folder (on device); on iOS 4, it is stored in the Application Support/database folder.
On iOS 5.0.1+, the database will be included in any other user data backed up to iCloud. See below for more info.
On Android, the database is created on the internal storage (you could move it, or use the install procedure to put it on external storage). The standard location on internal storage is /data/data/com.example.yourappid/databases/dbname
Alloy's default database is _alloy_
. But you can choose a different one. See here.
Last, I suggest you use Alloy's db migration than writing your own script to handle it. See here.