summaryrefslogtreecommitdiff
path: root/app/Schema
diff options
context:
space:
mode:
Diffstat (limited to 'app/Schema')
-rw-r--r--app/Schema/Mysql.php17
-rw-r--r--app/Schema/Sqlite.php16
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)
{