diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-03-12 23:03:51 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-03-12 23:03:51 -0400 |
commit | 4700139a86d1ef44eabe43edb5a4abff9c645811 (patch) | |
tree | a4bf846ff610a59d91fa6d0405b0460dbd2d9e31 /app/Schema | |
parent | 925ede9b48bef67739d26f0d0a394342f2d8edf0 (diff) |
Start to develop the budget module
Diffstat (limited to 'app/Schema')
-rw-r--r-- | app/Schema/Mysql.php | 15 | ||||
-rw-r--r-- | app/Schema/Postgres.php | 14 | ||||
-rw-r--r-- | app/Schema/Sqlite.php | 14 |
3 files changed, 40 insertions, 3 deletions
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 44ca7fd4..03868748 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -6,7 +6,20 @@ use PDO; use Core\Security; use Model\Link; -const VERSION = 51; +const VERSION = 52; + +function version_52($pdo) +{ + $pdo->exec('CREATE TABLE budget_lines ( + `id` INT NOT NULL AUTO_INCREMENT, + `project_id` INT NOT NULL, + `amount` FLOAT NOT NULL, + `date` VARCHAR(10) NOT NULL, + `comment` TEXT, + FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE, + PRIMARY KEY(id) + ) ENGINE=InnoDB CHARSET=utf8'); +} function version_51($pdo) { diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php index fe01b1e9..124aec76 100644 --- a/app/Schema/Postgres.php +++ b/app/Schema/Postgres.php @@ -6,7 +6,19 @@ use PDO; use Core\Security; use Model\Link; -const VERSION = 32; +const VERSION = 33; + +function version_33($pdo) +{ + $pdo->exec('CREATE TABLE budget_lines ( + "id" SERIAL PRIMARY KEY, + "project_id" INTEGER NOT NULL, + "amount" REAL NOT NULL, + "date" VARCHAR(10) NOT NULL, + "comment" TEXT, + FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE + )'); +} function version_32($pdo) { diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index eaa5c734..818ed78d 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -6,7 +6,19 @@ use Core\Security; use PDO; use Model\Link; -const VERSION = 50; +const VERSION = 51; + +function version_51($pdo) +{ + $pdo->exec('CREATE TABLE budget_lines ( + "id" INTEGER PRIMARY KEY, + "project_id" INTEGER NOT NULL, + "amount" REAL NOT NULL, + "date" TEXT NOT NULL, + "comment" TEXT, + FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE + )'); +} function version_50($pdo) { |