Add lastViewed of the Loadable to the database

multisite
Floens 10 years ago
parent a0111529f1
commit a167cf7703
  1. 10
      Clover/app/src/main/java/org/floens/chan/core/database/DatabaseHelper.java
  2. 1
      Clover/app/src/main/java/org/floens/chan/core/model/Loadable.java
  3. 4
      docs/database.txt

@ -43,7 +43,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
private static final String TAG = "DatabaseHelper";
private static final String DATABASE_NAME = "ChanDB";
private static final int DATABASE_VERSION = 19;
private static final int DATABASE_VERSION = 20;
public Dao<Pin, Integer> pinDao;
public Dao<Loadable, Integer> loadableDao;
@ -187,6 +187,14 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
Logger.e(TAG, "Error upgrading to version 19", e);
}
}
if (oldVersion < 20) {
try {
loadableDao.executeRawNoArgs("ALTER TABLE loadable ADD COLUMN lastViewed default -1;");
} catch (SQLException e) {
Logger.e(TAG, "Error upgrading to version 20", e);
}
}
}
public void reset() {

@ -48,6 +48,7 @@ public class Loadable {
@DatabaseField
public int listViewTop;
@DatabaseField
public int lastViewed = -1;
public int markedNo = -1;

@ -56,3 +56,7 @@ CREATE TABLE `history` (`date` BIGINT , `id` INTEGER PRIMARY KEY AUTOINCREMENT ,
Changes in version 19:
CREATE TABLE `filter` (`action` INTEGER NOT NULL , `allBoards` SMALLINT NOT NULL , `boards` VARCHAR NOT NULL , `color` INTEGER NOT NULL , `enabled` SMALLINT NOT NULL , `id` INTEGER PRIMARY KEY AUTOINCREMENT , `pattern` VARCHAR NOT NULL , `type` INTEGER NOT NULL )
Changes in version 20:
ALTER TABLE loadable ADD COLUMN lastViewed default -1;

Loading…
Cancel
Save