summaryrefslogtreecommitdiff
path: root/app/Schema
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-06-25 10:07:06 -0300
committerFrédéric Guillot <fred@kanboard.net>2014-06-25 10:07:06 -0300
commite5e355d06890b324df2ded707ca491f9539dd171 (patch)
treeec176a2a9eab58d9f0b7b661378f80442ca6a9b3 /app/Schema
parent60cc58c940537e299cee388d8b1d8c56e27e2d80 (diff)
Merge pull-request #140 (several small fixes)
Diffstat (limited to 'app/Schema')
-rw-r--r--app/Schema/Mysql.php5
-rw-r--r--app/Schema/Sqlite.php7
2 files changed, 7 insertions, 5 deletions
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php
index ddb2acee..7ff130cf 100644
--- a/app/Schema/Mysql.php
+++ b/app/Schema/Mysql.php
@@ -2,11 +2,12 @@
namespace Schema;
+use Core\Security;
const VERSION = 19;
function version_19($pdo)
{
- $pdo->exec("ALTER TABLE config ADD COLUMN api_token VARCHAR(255) DEFAULT '".\Core\Security::generateToken()."'");
+ $pdo->exec("ALTER TABLE config ADD COLUMN api_token VARCHAR(255) DEFAULT '".Security::generateToken()."'");
}
function version_18($pdo)
@@ -268,6 +269,6 @@ function version_1($pdo)
$pdo->exec("
INSERT INTO config
(webhooks_token)
- VALUES ('".\Core\Security::generateToken()."')
+ VALUES ('".Security::generateToken()."')
");
}
diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php
index 438769f0..8f8e498a 100644
--- a/app/Schema/Sqlite.php
+++ b/app/Schema/Sqlite.php
@@ -1,12 +1,13 @@
<?php
namespace Schema;
+use Core\Security;
const VERSION = 19;
function version_19($pdo)
{
- $pdo->exec("ALTER TABLE config ADD COLUMN api_token TEXT DEFAULT '".\Core\Security::generateToken()."'");
+ $pdo->exec("ALTER TABLE config ADD COLUMN api_token TEXT DEFAULT '".Security::generateToken()."'");
}
function version_18($pdo)
@@ -214,7 +215,7 @@ function version_3($pdo)
foreach ($results as &$result) {
$rq = $pdo->prepare('UPDATE projects SET token=? WHERE id=?');
- $rq->execute(array(\Core\Security::generateToken(), $result['id']));
+ $rq->execute(array(Security::generateToken(), $result['id']));
}
}
}
@@ -289,6 +290,6 @@ function version_1($pdo)
$pdo->exec("
INSERT INTO config
(language, webhooks_token)
- VALUES ('en_US', '".\Core\Security::generateToken()."')
+ VALUES ('en_US', '".Security::generateToken()."')
");
}