Bug fix token not in the default database creation

pull/1/head release_v1
Schoumi 8 years ago
parent 8fcedd5b85
commit c7adb7937c
  1. 2
      app/build.gradle
  2. 6
      app/src/main/java/fr/mobdev/goblim/Database.java

@ -8,7 +8,7 @@ android {
applicationId "fr.mobdev.goblim"
minSdkVersion 11
targetSdkVersion 22
versionCode 1
versionCode 2
versionName "1.0"
}
buildTypes {

@ -43,7 +43,7 @@ public class Database extends SQLiteOpenHelper {
public static Database getInstance(Context context)
{
if(instance == null)
instance = new Database(context, "Lutim.db", null, 2);
instance = new Database(context, "Lutim.db", null, 3);
return instance;
}
@ -54,7 +54,7 @@ public class Database extends SQLiteOpenHelper {
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("Create table if not exists history (" +
"id integer primary key autoincrement, url varchar(1024), short_hash varchar(1024), real_short_hash varchar(1024), date INTEGER, storage_duration INTEGER ,thumb TEXT);");
"id integer primary key autoincrement, url varchar(1024), short_hash varchar(1024), real_short_hash varchar(1024), date INTEGER, storage_duration INTEGER ,thumb TEXT, token varchar(1024));");
db.execSQL("Create table if not exists servers (" +
"id integer primary key autoincrement, url varchar(1024), isDefault INTEGER);");
@ -70,7 +70,7 @@ public class Database extends SQLiteOpenHelper {
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
if(oldVersion == 1)
if(oldVersion == 2)
{
db.execSQL("Alter table history add column token varchar(1024);");
}

Loading…
Cancel
Save