diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-03-28 18:00:18 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-03-28 18:00:18 -0400 |
commit | 9bfab51e00608b6e008aa71f6df74104b28fc662 (patch) | |
tree | c390346c8ed384c78bf85bbdd950d70bd9a9ab51 /app/Schema/Mysql.php | |
parent | eb6853c163e9059bbbc89a1a741d4a25c8e04153 (diff) |
Add currency rates for budget calculation
Diffstat (limited to 'app/Schema/Mysql.php')
-rw-r--r-- | app/Schema/Mysql.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 30fccbfa..bac65ec4 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -6,7 +6,15 @@ use PDO; use Core\Security; use Model\Link; -const VERSION = 56; +const VERSION = 57; + +function version_57($pdo) +{ + $pdo->exec('CREATE TABLE currencies (`currency` CHAR(3) NOT NULL UNIQUE, `rate` FLOAT DEFAULT 0) ENGINE=InnoDB CHARSET=utf8'); + + $rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)'); + $rq->execute(array('application_currency', 'USD')); +} function version_56($pdo) { @@ -115,7 +123,7 @@ function version_50($pdo) user_id INT NOT NULL, rate FLOAT DEFAULT 0, date_effective INTEGER NOT NULL, - currency TEXT NOT NULL, + currency CHAR(3) NOT NULL, FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE, PRIMARY KEY(id) ) ENGINE=InnoDB CHARSET=utf8"); |