diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-05-22 20:58:21 -0400 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-05-22 20:58:21 -0400 |
commit | 40917992e775bd21a280eb267241c452e04e5ade (patch) | |
tree | c1bf82ab83564bc9ca749f026f54342cbd35374f /app/Schema | |
parent | 2230dd4e6b148346c0ec596b9e3e12996a762ed8 (diff) |
Add files upload
Diffstat (limited to 'app/Schema')
-rw-r--r-- | app/Schema/Mysql.php | 17 | ||||
-rw-r--r-- | app/Schema/Sqlite.php | 16 |
2 files changed, 31 insertions, 2 deletions
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) { |