diff options
Diffstat (limited to 'app/Schema/Mysql.php')
-rw-r--r-- | app/Schema/Mysql.php | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php index 274ce8c8..ca9f45ad 100644 --- a/app/Schema/Mysql.php +++ b/app/Schema/Mysql.php @@ -6,7 +6,48 @@ use PDO; use Kanboard\Core\Security\Token; use Kanboard\Core\Security\Role; -const VERSION = 115; +const VERSION = 121; + +function version_121(PDO $pdo) +{ + $pdo->exec('ALTER TABLE projects ADD COLUMN email VARCHAR(255)'); +} + +function version_120(PDO $pdo) +{ + $pdo->exec(" + CREATE TABLE invites ( + email VARCHAR(255) NOT NULL, + project_id INTEGER NOT NULL, + token VARCHAR(255) NOT NULL, + PRIMARY KEY(email, token) + ) ENGINE=InnoDB CHARSET=utf8 + "); + + $pdo->exec("DELETE FROM settings WHERE `option`='application_datetime_format'"); +} + +function version_119(PDO $pdo) +{ + $pdo->exec('ALTER TABLE `comments` ADD COLUMN `date_modification` BIGINT(20)'); + $pdo->exec('UPDATE `comments` SET `date_modification` = `date_creation` WHERE `date_modification` IS NULL'); +} + +function version_118(PDO $pdo) +{ + $pdo->exec('ALTER TABLE `users` ADD COLUMN `api_access_token` VARCHAR(255) DEFAULT NULL'); +} + +function version_117(PDO $pdo) +{ + $pdo->exec("ALTER TABLE `settings` MODIFY `value` TEXT"); +} + +function version_116(PDO $pdo) +{ + $pdo->exec("ALTER TABLE tasks ADD COLUMN external_provider VARCHAR(255)"); + $pdo->exec("ALTER TABLE tasks ADD COLUMN external_uri VARCHAR(255)"); +} function version_115(PDO $pdo) { @@ -47,9 +88,9 @@ function version_113(PDO $pdo) $pdo->exec(" CREATE TABLE project_has_roles ( role_id INT NOT NULL AUTO_INCREMENT, - role VARCHAR(255) NOT NULL, + `role` VARCHAR(255) NOT NULL, project_id INT NOT NULL, - UNIQUE(project_id, role), + UNIQUE(project_id, `role`), FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE, PRIMARY KEY(role_id) ) ENGINE=InnoDB CHARSET=utf8 |