Fixes issue #40 - Missing table

This commit is contained in:
stom79 2017-11-15 16:51:35 +01:00
parent bff2af7bd9
commit 742e6d2cd2
1 changed files with 7 additions and 1 deletions

View File

@ -26,7 +26,7 @@ import android.database.sqlite.SQLiteOpenHelper;
@SuppressWarnings("WeakerAccess")
public class Sqlite extends SQLiteOpenHelper {
public static final int DB_VERSION = 4;
public static final int DB_VERSION = 5;
public static final String DB_NAME = "mastodon_etalab_db";
public static SQLiteDatabase db;
private static Sqlite sInstance;
@ -112,6 +112,7 @@ public class Sqlite extends SQLiteOpenHelper {
public void onCreate(SQLiteDatabase db) {
db.execSQL(CREATE_TABLE_USER_ACCOUNT);
db.execSQL(CREATE_TABLE_STATUSES_STORED);
db.execSQL(CREATE_TABLE_CUSTOM_EMOJI);
}
@Override
@ -124,6 +125,11 @@ public class Sqlite extends SQLiteOpenHelper {
db.execSQL(CREATE_TABLE_STATUSES_STORED);
case 3:
db.execSQL(CREATE_TABLE_CUSTOM_EMOJI);
case 4:
db.execSQL("CREATE TABLE IF NOT EXISTS " + TABLE_CUSTOM_EMOJI + " ("
+ COL_ID + " INTEGER PRIMARY KEY AUTOINCREMENT, "
+ COL_SHORTCODE + " TEXT NOT NULL, " + COL_INSTANCE + " TEXT NOT NULL, "
+ COL_URL + " TEXT NOT NULL, " + COL_URL_STATIC + " TEXT NOT NULL, " + COL_DATE_CREATION + " TEXT NOT NULL)");
default:
break;
}