DSpotDevelopers / declex

DecleX - Declarative Framework for Android, easier and faster coding.
Other
168 stars 25 forks source link

LocalDB Model add new column #247

Closed email4shahbaz closed 5 years ago

email4shahbaz commented 5 years ago

I have a Model class User, I added a new column "age", when I run the app on a devices already have my app installed, it crashed with following error: "no such column 'age' exists".

I uninstalled and reinstalled the app on device and it worked (probably uninstalling the app removed db and created table 'user' with new filed 'age' added.

How can I add a new column/fields to existing local db table without such crash?

smaugho commented 5 years ago

@email4shahbaz , LocalDB Model is using ActiveAndroid, so you should use the migration mechanism of this lib:

https://github.com/pardom-zz/ActiveAndroid/wiki/Schema-migrations

email4shahbaz commented 5 years ago

Hi @smaugho , Thanks for the hint. I will try it.