From b060f606a87ab55f4cb9aca7a3e3f1319e0e3ff7 Mon Sep 17 00:00:00 2001 From: lado Date: Fri, 15 Mar 2013 16:01:50 +0100 Subject: Time Zone --- .../src/de/bjusystems/vdrmanager/data/db/DBAccess.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3