diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-02-14 15:25:16 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-02-14 15:25:16 -0500 |
commit | 8e25c875f26b05e3138fb4d09d9f720456c09f76 (patch) | |
tree | 103921f8ba3734a7c524efd0ed0ab68d4f919a13 /app/Schema/Sqlite.php | |
parent | fbb58e08d3dbe0ec39f5d71d6aaa64528293bc71 (diff) |
Add ProjecFile and TaskFile models
Diffstat (limited to 'app/Schema/Sqlite.php')
-rw-r--r-- | app/Schema/Sqlite.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index aa10e58b..e88f621f 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -6,7 +6,26 @@ use Kanboard\Core\Security\Token; use Kanboard\Core\Security\Role; use PDO; -const VERSION = 97; +const VERSION = 98; + +function version_98(PDO $pdo) +{ + $pdo->exec('ALTER TABLE files RENAME TO task_has_files'); + + $pdo->exec(" + CREATE TABLE project_has_files ( + id INTEGER PRIMARY KEY, + project_id INTEGER NOT NULL, + name TEXT COLLATE NOCASE NOT NULL, + path TEXT NOT NULL, + is_image INTEGER DEFAULT 0, + size INTEGER DEFAULT 0 NOT NULL, + user_id INTEGER DEFAULT 0 NOT NULL, + date INTEGER DEFAULT 0 NOT NULL, + FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE + )" + ); +} function version_97(PDO $pdo) { |