From c7adb7937c0096bb03c1d3eee0c85264158fbedf Mon Sep 17 00:00:00 2001 From: Schoumi Date: Sat, 25 Jul 2015 15:38:34 +0200 Subject: [PATCH] Bug fix token not in the default database creation --- app/build.gradle | 2 +- app/src/main/java/fr/mobdev/goblim/Database.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b40252b..5b92a8e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,7 +8,7 @@ android { applicationId "fr.mobdev.goblim" minSdkVersion 11 targetSdkVersion 22 - versionCode 1 + versionCode 2 versionName "1.0" } buildTypes { diff --git a/app/src/main/java/fr/mobdev/goblim/Database.java b/app/src/main/java/fr/mobdev/goblim/Database.java index 4d48f69..85fefcf 100644 --- a/app/src/main/java/fr/mobdev/goblim/Database.java +++ b/app/src/main/java/fr/mobdev/goblim/Database.java @@ -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);"); }