agrosner / DBFlow

A blazing fast, powerful, and very simple ORM android database library that writes database code for you.
MIT License
4.87k stars 598 forks source link

how to use Migration0 #1414

Closed gwokwong closed 7 years ago

gwokwong commented 7 years ago

I want to initialize some data,The assets directory has delegated the SQL file, but it cannot be called. How do you use it?

@Database(name = AppDataBase.DB_NAME, version = AppDataBase.VERSION) public class AppDataBase{

public static final String DB_NAME = "AppDataBase";

public static final int VERSION = 1;

@Migration(version = 0, database = AppDataBase.class)
public static class Migration_0 extends BaseMigration {

    @Override
    public void migrate(DatabaseWrapper database)
    {

    }
}

}

sql: INSERT INTO "parameter" VALUES (1, '2017-08-24 16:35:50');

application FlowManager.init(this);

agrosner commented 7 years ago

just call it on the DatabaseWrapper object. database.execSQL("INSERT INTO "parameter" VALUES (1, '2017-08-24 16:35:50');")