summaryrefslogtreecommitdiff
path: root/app/Schema
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-02-07 23:28:17 -0500
committerFrederic Guillot <fred@kanboard.net>2015-02-07 23:28:17 -0500
commit00b9508d8178bae016b2a25a81282dbe9ae0a9d2 (patch)
tree488397b9830b9ee56ff3eb4752958ea7a44eec04 /app/Schema
parent607d9dc79429cefa51dfe1739564922cc9a2ab89 (diff)
Be able to disable the login form for specific users
Diffstat (limited to 'app/Schema')
-rw-r--r--app/Schema/Mysql.php7
-rw-r--r--app/Schema/Postgres.php19
-rw-r--r--app/Schema/Sqlite.php7
3 files changed, 24 insertions, 9 deletions
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php
index 5a52288b..9c066625 100644
--- a/app/Schema/Mysql.php
+++ b/app/Schema/Mysql.php
@@ -5,7 +5,12 @@ namespace Schema;
use PDO;
use Core\Security;
-const VERSION = 43;
+const VERSION = 44;
+
+function version_44($pdo)
+{
+ $pdo->exec('ALTER TABLE users ADD COLUMN disable_login_form TINYINT(1) DEFAULT 0');
+}
function version_43($pdo)
{
diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php
index 7aa1c457..52130c96 100644
--- a/app/Schema/Postgres.php
+++ b/app/Schema/Postgres.php
@@ -5,7 +5,12 @@ namespace Schema;
use PDO;
use Core\Security;
-const VERSION = 24;
+const VERSION = 25;
+
+function version_25($pdo)
+{
+ $pdo->exec("ALTER TABLE users ADD COLUMN disable_login_form BOOLEAN DEFAULT '1'");
+}
function version_24($pdo)
{
@@ -13,17 +18,17 @@ function version_24($pdo)
$rq->execute(array('subtask_restriction', '0'));
$rq->execute(array('subtask_time_tracking', '0'));
- $pdo->exec("
+ $pdo->exec('
CREATE TABLE subtask_time_tracking (
id SERIAL PRIMARY KEY,
- user_id INTEGER NOT NULL,
- subtask_id INTEGER NOT NULL,
- start INTEGER DEFAULT 0,
- end INTEGER DEFAULT 0,
+ "user_id" INTEGER NOT NULL,
+ "subtask_id" INTEGER NOT NULL,
+ "start" INTEGER DEFAULT 0,
+ "end" INTEGER DEFAULT 0,
FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY(subtask_id) REFERENCES task_has_subtasks(id) ON DELETE CASCADE
)
- ");
+ ');
}
function version_23($pdo)
diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php
index 17166e64..37483945 100644
--- a/app/Schema/Sqlite.php
+++ b/app/Schema/Sqlite.php
@@ -5,7 +5,12 @@ namespace Schema;
use Core\Security;
use PDO;
-const VERSION = 42;
+const VERSION = 43;
+
+function version_43($pdo)
+{
+ $pdo->exec('ALTER TABLE users ADD COLUMN disable_login_form INTEGER DEFAULT 0');
+}
function version_42($pdo)
{