diff --git a/app/src/main/java/rikka/searchbyimage/database/DataBaseHelper.java b/app/src/main/java/rikka/searchbyimage/database/DataBaseHelper.java index 0105c52..b326be6 100644 --- a/app/src/main/java/rikka/searchbyimage/database/DataBaseHelper.java +++ b/app/src/main/java/rikka/searchbyimage/database/DataBaseHelper.java @@ -10,7 +10,7 @@ * Created by Rikka on 2016/1/24. */ public class DatabaseHelper extends SQLiteOpenHelper{ - public static final int DATABASE_VERSION = 1; + public static final int DATABASE_VERSION = 2; public static final String DATABASE_NAME = "search_engines.db"; private static DatabaseHelper instance; @@ -33,6 +33,8 @@ public void onCreate(SQLiteDatabase db) { @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { - + if (newVersion == 2) { + db.execSQL("ALTER TABLE " + CustomEngineTable.TABLE_NAME + " ADD " + CustomEngineTable.COLUMN_ENABLED + " integer NOT NULL DEFAULT(1)"); + } } -} +} \ No newline at end of file