From 7c5b900bd83b6b9bdb5656eb169381ff46f8106a Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 20 Jun 2014 15:41:05 -0300 Subject: First API implementation --- app/Schema/Mysql.php | 7 ++++++- app/Schema/Sqlite.php | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'app/Schema') diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 5c7e256f..ddb2acee 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -2,7 +2,12 @@ namespace Schema; -const VERSION = 18; +const VERSION = 19; + +function version_19($pdo) +{ + $pdo->exec("ALTER TABLE config ADD COLUMN api_token VARCHAR(255) DEFAULT '".\Core\Security::generateToken()."'"); +} function version_18($pdo) { diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index bfe81c13..438769f0 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -2,7 +2,12 @@ namespace Schema; -const VERSION = 18; +const VERSION = 19; + +function version_19($pdo) +{ + $pdo->exec("ALTER TABLE config ADD COLUMN api_token TEXT DEFAULT '".\Core\Security::generateToken()."'"); +} function version_18($pdo) { -- cgit v1.2.3