新年快乐。
如何通过内部项目文件创建会议室迁移?
例如:我在路径/assets/migrations/10.sql
我有这种方法:
private static final Migration MIGRATION_9_10 = new Migration(9, 10) {
@Override
public void migrate(SupportSQLiteDatabase database) {
String scriptId = "10_"+DATABASE_LANGUAGE+".sql";
Log.d("TEST", "MIGRATE TO 10: " + database.getVersion()+"NME: "+scriptId);
InputStream inputStream = null;
try {
inputStream = DATABASE_CONTEXT.getAssets().open(scriptId);
Log.d("TEST", "InputStream: " + inputStream.toString());
database.execSQL(readString(inputStream));
//db.execSQL(initSql);
} catch (IOException e) {
e.printStackTrace();
} finally {
IOUtils.closeQuietly(inputStream);
}
}
};
,但此表在日志中始终为空。 我该如何纠正? 谢谢!