From 40917992e775bd21a280eb267241c452e04e5ade Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Thu, 22 May 2014 20:58:21 -0400 Subject: Add files upload --- app/Schema/Mysql.php | 17 ++++++++++++++++- app/Schema/Sqlite.php | 16 +++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) (limited to 'app/Schema') diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 6764ad5d..d3b111f9 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -2,7 +2,22 @@ namespace Schema; -const VERSION = 16; +const VERSION = 17; + +function version_17($pdo) +{ + $pdo->exec(" + CREATE TABLE task_has_files ( + id INT NOT NULL AUTO_INCREMENT, + name VARCHAR(50), + path VARCHAR(255), + is_image TINYINT(1) DEFAULT 0, + task_id INT, + PRIMARY KEY (id), + FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE + ) ENGINE=InnoDB CHARSET=utf8" + ); +} function version_16($pdo) { diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index 0bb4de8d..94ef0316 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -2,7 +2,21 @@ namespace Schema; -const VERSION = 16; +const VERSION = 17; + +function version_17($pdo) +{ + $pdo->exec(" + CREATE TABLE task_has_files ( + id INTEGER PRIMARY KEY, + name TEXT COLLATE NOCASE, + path TEXT, + is_image INTEGER DEFAULT 0, + task_id INTEGER, + FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE + )" + ); +} function version_16($pdo) { -- cgit v1.2.3