@Test public void addColumnStringTest() throws Exception { String example = "ALTER TABLE table_name ADD COLUMN column_name INTEGER"; assertEquals(example + " DEFAULT 123", MParticleDatabaseHelper.addIntegerColumnString("table_name", "column_name", "123")); assertEquals(example, MParticleDatabaseHelper.addColumnString("table_name", "column_name", "INTEGER")); example = example + " DEFAULT abcd"; assertEquals(example, MParticleDatabaseHelper.addColumnString("table_name", "column_name", "INTEGER", "abcd")); }
static String addColumnString(String tableName, String columnName, String type) { return addColumnString(tableName, columnName, type, null); }
MParticleDatabaseHelper implements SQLiteOpenHelperWrapper { static String addColumnString(String tableName, String columnName, String type) { return addColumnString(tableName, columnName, type, null); } }
MParticleDatabaseHelper implements SQLiteOpenHelperWrapper { static String addColumnString(String tableName, String columnName, String type) { return addColumnString(tableName, columnName, type, null); } MParticleDatabaseHelper(Context context); }
MParticleDatabaseHelper implements SQLiteOpenHelperWrapper { static String addColumnString(String tableName, String columnName, String type) { return addColumnString(tableName, columnName, type, null); } MParticleDatabaseHelper(Context context); @Override void onCreate(SQLiteDatabase db); @Override void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion); @Override void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion); }
MParticleDatabaseHelper implements SQLiteOpenHelperWrapper { static String addColumnString(String tableName, String columnName, String type) { return addColumnString(tableName, columnName, type, null); } MParticleDatabaseHelper(Context context); @Override void onCreate(SQLiteDatabase db); @Override void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion); @Override void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion); static final int DB_VERSION; static final String DB_NAME; }