summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/data/db/DBAccess.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/db/DBAccess.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/db/DBAccess.java
index 5d1e10a..f9ae121 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/data/db/DBAccess.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/db/DBAccess.java
@@ -1,6 +1,7 @@
package de.bjusystems.vdrmanager.data.db;
import java.sql.SQLException;
+import java.util.TimeZone;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
@@ -77,10 +78,19 @@ public class DBAccess extends OrmLiteSqliteOpenHelper {
// TableUtils.dropTable(connectionSource, Vdr.class, true);
// after we drop the old databases, we create the new ones
// onCreate(db, connectionSource);
-
+
if (oldVersion < 3) {
TableUtils.createTable(connectionSource, RecenteChannel.class);
+ getVdrDAO()
+ .executeRaw(
+ "ALTER TABLE `vdr` ADD COLUMN stz varchar;");
+
+ String tz = TimeZone.getDefault().getID();
+ getVdrDAO()
+ .executeRaw(
+ "UPDATE `vdr` set stz = ?", tz);
}
+
} catch (SQLException e) {
Log.e(DBAccess.class.getName(), "Can't drop databases", e);