how to update dbflow databse when i add some data only in table, not rename or add colume

235 views Asked by At

I am using DBFLOW library, I have prepacked database. now I want to add new data to my database in two tables, when I increase the version database and update my app, the old version of the database is still showing. I think I should use Migration, but I don't know how to use it when I just change some data without rename or add columns.

@Database(name = BookDatabase.NAME, version = BookDatabase.VERSION, foreignKeysSupported = true, backupEnabled = true, consistencyCheckEnabled = true)

public class BookDatabase {
    public static final String NAME = "book_list";
    public static final int VERSION = 2;

    @Migration(version = 2, database = BookDatabase.class)
    public static class Migration2 extends BaseMigration {

        @Override
        public void migrate(DatabaseWrapper database) {

//            I don't know what should I write here !!
        }
    }
}
0

There are 0 answers