diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-09-12 17:35:48 +0200 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-09-12 17:35:48 +0200 |
commit | 2e6a8d435f4fa73882224b465716360ee2e7c693 (patch) | |
tree | 9839a499905c350cd02d56454a25b90a79ede41f /app/Schema/Sqlite.php | |
parent | c3a0cf43430438bfe7e7b0ccccfadb72a74331d6 (diff) |
Add settings field to control project columns (pull-request #244)
Diffstat (limited to 'app/Schema/Sqlite.php')
-rw-r--r-- | app/Schema/Sqlite.php | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index ecd62c97..cab69fa0 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -4,7 +4,12 @@ namespace Schema; use Core\Security; -const VERSION = 25; +const VERSION = 26; + +function version_26($pdo) +{ + $pdo->exec("ALTER TABLE config ADD COLUMN default_columns TEXT DEFAULT ''"); +} function version_25($pdo) { @@ -97,7 +102,8 @@ function version_20($pdo) function version_19($pdo) { - $pdo->exec("ALTER TABLE config ADD COLUMN api_token TEXT DEFAULT '".Security::generateToken()."'"); + $pdo->exec("ALTER TABLE config ADD COLUMN api_token TEXT DEFAULT ''"); + $pdo->exec("UPDATE config SET api_token='".Security::generateToken()."'"); } function version_18($pdo) @@ -307,8 +313,8 @@ function version_1($pdo) { $pdo->exec(" CREATE TABLE config ( - language TEXT, - webhooks_token TEXT + language TEXT DEFAULT 'en_US', + webhooks_token TEXT DEFAULT '' ) "); @@ -366,7 +372,7 @@ function version_1($pdo) $pdo->exec(" INSERT INTO config - (language, webhooks_token) - VALUES ('en_US', '".Security::generateToken()."') + (webhooks_token) + VALUES ('".Security::generateToken()."') "); } |