private void executeCreate(SQLiteDatabase db) { db.beginTransaction(); try { for (TableInfo tableInfo : Cache.getTableInfos()) { db.execSQL(SQLiteUtils.createTableDefinition(tableInfo)); } db.setTransactionSuccessful(); } finally { db.endTransaction(); } }
private void executeCreateIndex(SQLiteDatabase db) { db.beginTransaction(); try { for (TableInfo tableInfo : Cache.getTableInfos()) { String[] definitions = SQLiteUtils.createIndexDefinition(tableInfo); for (String definition : definitions) { db.execSQL(definition); } } db.setTransactionSuccessful(); } finally { db.endTransaction(); } }