|
|
|
@ -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);"); |
|
|
|
|
} |
|
|
|
|