summaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
authorrzeka <piotr@rzeka.net>2014-02-24 21:08:56 +0100
committerrzeka <piotr@rzeka.net>2014-02-24 21:08:56 +0100
commite374a6fd6499b50d4587d136490ced7444f8bc2b (patch)
tree9e620688d4291c4d2877b7156776f00438092f9e /models
parentb4784d39e11c2d576076930bb700bf146321bf62 (diff)
Fixed timezone warning by adding timezone config option
Diffstat (limited to 'models')
-rw-r--r--models/base.php2
-rw-r--r--models/schema.php8
2 files changed, 9 insertions, 1 deletions
diff --git a/models/base.php b/models/base.php
index 3c071623..e512e9db 100644
--- a/models/base.php
+++ b/models/base.php
@@ -17,7 +17,7 @@ require __DIR__.'/schema.php';
abstract class Base
{
const APP_VERSION = 'master';
- const DB_VERSION = 3;
+ const DB_VERSION = 4;
const DB_FILENAME = 'data/db.sqlite';
private static $dbInstance = null;
diff --git a/models/schema.php b/models/schema.php
index 84926d73..3704aad1 100644
--- a/models/schema.php
+++ b/models/schema.php
@@ -2,6 +2,14 @@
namespace Schema;
+function version_4($pdo)
+{
+ $pdo->exec('ALTER TABLE config ADD column timezone TEXT');
+
+ //set default timezone to UTC
+ $pdo->exec('UPDATE config SET timezone = \'UTC\'');
+}
+
function version_3($pdo)
{
$pdo->exec('ALTER TABLE projects ADD column token TEXT');