diff options
Diffstat (limited to 'app/Schema/Sqlite.php')
-rw-r--r-- | app/Schema/Sqlite.php | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php index f290c824..3c220f8c 100644 --- a/app/Schema/Sqlite.php +++ b/app/Schema/Sqlite.php @@ -5,7 +5,29 @@ namespace Schema; use Core\Security; use PDO; -const VERSION = 32; +const VERSION = 33; + +function version_33($pdo) +{ + $pdo->exec(" + CREATE TABLE project_activities ( + id INTEGER PRIMARY KEY, + date_creation INTEGER NOT NULL, + event_name TEXT NOT NULL, + creator_id INTEGER, + project_id INTEGER, + task_id INTEGER, + data TEXT, + FOREIGN KEY(creator_id) REFERENCES users(id) ON DELETE CASCADE, + FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE, + FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE + ) + "); + + $pdo->exec('DROP TABLE task_has_events'); + $pdo->exec('DROP TABLE comment_has_events'); + $pdo->exec('DROP TABLE subtask_has_events'); +} function version_32($pdo) { |