Add currency rates for budget calculation

This commit is contained in:
Frederic Guillot
2015-03-28 18:00:18 -04:00
parent eb6853c163
commit 9bfab51e00
27 changed files with 420 additions and 7 deletions

View File

@@ -6,7 +6,15 @@ use PDO;
use Core\Security;
use Model\Link;
const VERSION = 37;
const VERSION = 38;
function version_38($pdo)
{
$pdo->exec('CREATE TABLE currencies ("currency" CHAR(3) NOT NULL UNIQUE, "rate" REAL DEFAULT 0)');
$rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');
$rq->execute(array('application_currency', 'USD'));
}
function version_37($pdo)
{
@@ -109,7 +117,7 @@ function version_31($pdo)
user_id INTEGER NOT NULL,
rate REAL 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
)");
}