summaryrefslogtreecommitdiff
path: root/app/Schema
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2017-01-22 22:38:00 -0500
committerFrederic Guillot <fred@kanboard.net>2017-01-22 22:38:00 -0500
commit10d96bfd668f445249190c52bedb2eb0e7e9410d (patch)
tree951bcf637b9371529a6552a2efd22e7a84707d9e /app/Schema
parent2f43d365a0aaeff638eb4731bcff6907b491633a (diff)
Add user invitations
Diffstat (limited to 'app/Schema')
-rw-r--r--app/Schema/Mysql.php18
-rw-r--r--app/Schema/Postgres.php18
-rw-r--r--app/Schema/Sqlite.php18
3 files changed, 42 insertions, 12 deletions
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php
index 6c1c9da6..fe376018 100644
--- a/app/Schema/Mysql.php
+++ b/app/Schema/Mysql.php
@@ -6,14 +6,24 @@ use PDO;
use Kanboard\Core\Security\Token;
use Kanboard\Core\Security\Role;
-const VERSION = 119;
+const VERSION = 120;
+
+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
+ ");
+}
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');
+ $pdo->exec('UPDATE `comments` SET `date_modification` = `date_creation` WHERE `date_modification` IS NULL');
}
function version_118(PDO $pdo)
diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php
index e7f89f82..fd7ecb57 100644
--- a/app/Schema/Postgres.php
+++ b/app/Schema/Postgres.php
@@ -6,14 +6,24 @@ use PDO;
use Kanboard\Core\Security\Token;
use Kanboard\Core\Security\Role;
-const VERSION = 98;
+const VERSION = 99;
+
+function version_99(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)
+ )
+ ");
+}
function version_98(PDO $pdo)
{
$pdo->exec('ALTER TABLE "comments" ADD COLUMN date_modification BIGINT');
- $pdo->exec('UPDATE "comments"
- SET date_modification = date_creation
- WHERE date_modification IS NULL');
+ $pdo->exec('UPDATE "comments" SET date_modification = date_creation WHERE date_modification IS NULL');
}
function version_97(PDO $pdo)
diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php
index d2a7899e..a726a572 100644
--- a/app/Schema/Sqlite.php
+++ b/app/Schema/Sqlite.php
@@ -6,14 +6,24 @@ use Kanboard\Core\Security\Token;
use Kanboard\Core\Security\Role;
use PDO;
-const VERSION = 109;
+const VERSION = 110;
+
+function version_110(PDO $pdo)
+{
+ $pdo->exec("
+ CREATE TABLE invites (
+ email TEXT NOT NULL,
+ project_id INTEGER NOT NULL,
+ token TEXT NOT NULL,
+ PRIMARY KEY(email, token)
+ )
+ ");
+}
function version_109(PDO $pdo)
{
$pdo->exec('ALTER TABLE comments ADD COLUMN date_modification INTEGER');
- $pdo->exec('UPDATE comments
- SET date_modification = date_creation
- WHERE date_modification IS NULL;');
+ $pdo->exec('UPDATE comments SET date_modification = date_creation WHERE date_modification IS NULL;');
}
function version_108(PDO $pdo)