LTroya
LTroya

Reputation: 540

How to manage versioning with SugarORM

How can I handle versioning with SugarORM?

For Example,

Database version 1 has only model User, but database version 2 has user, post, favorites and so on.

For example with SQLiteOpenHelper I can use the onCreate() and onUpdate() methods to handle it.

Or I don't have to worried about that?

I was reading the SugarORM doc, but I don't find any info related to it.

Upvotes: 0

Views: 46

Answers (1)

tianyu
tianyu

Reputation: 179

You need update meta-data version in AndroidManifest manifest example

<meta-data
        android:name="VERSION"
        android:value="2"/>

If you modified User, then you need add a 2.sql file under assets/sugar_upgrades directory.

Please check more details here and my example

Upvotes: 1

Related Questions