diff options
author | lado <herrlado@gmail.com> | 2013-03-15 16:01:50 +0100 |
---|---|---|
committer | lado <herrlado@gmail.com> | 2013-03-15 16:01:50 +0100 |
commit | b060f606a87ab55f4cb9aca7a3e3f1319e0e3ff7 (patch) | |
tree | a6f14674529968b35f04682030c397d0fef46691 /vdrmanager | |
parent | 93d49dce8c4207f81cffc58b08550fac2a6de2b9 (diff) | |
download | vdr-manager-b060f606a87ab55f4cb9aca7a3e3f1319e0e3ff7.tar.gz vdr-manager-b060f606a87ab55f4cb9aca7a3e3f1319e0e3ff7.tar.bz2 |
Time Zone
Diffstat (limited to 'vdrmanager')
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/data/db/DBAccess.java | 12 |
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); |