summaryrefslogtreecommitdiff
path: root/app/Schema
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-09-13 14:07:56 -0400
committerFrederic Guillot <fred@kanboard.net>2015-09-13 14:07:56 -0400
commita6a00a00400f164c4b18094999a5ed72366dd519 (patch)
tree7d2bfc3fe4a36649f9092463228f4553979aef94 /app/Schema
parentc405f99fc8b7420b3e69c633b3259756a1ceb2f2 (diff)
First draft for plugins system
Diffstat (limited to 'app/Schema')
-rw-r--r--app/Schema/Mysql.php13
-rw-r--r--app/Schema/Postgres.php12
-rw-r--r--app/Schema/Sqlite.php12
3 files changed, 34 insertions, 3 deletions
diff --git a/app/Schema/Mysql.php b/app/Schema/Mysql.php
index efdb159b..5a12bb3c 100644
--- a/app/Schema/Mysql.php
+++ b/app/Schema/Mysql.php
@@ -6,7 +6,18 @@ use PDO;
use Core\Security;
use Model\Link;
-const VERSION = 86;
+const VERSION = 87;
+
+function version_87($pdo)
+{
+ $pdo->exec("
+ CREATE TABLE plugin_schema_versions (
+ plugin VARCHAR(80) NOT NULL,
+ version INT NOT NULL DEFAULT 0,
+ PRIMARY KEY(plugin)
+ ) ENGINE=InnoDB CHARSET=utf8
+ ");
+}
function version_86($pdo)
{
diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php
index a5d28dcf..ad460cc7 100644
--- a/app/Schema/Postgres.php
+++ b/app/Schema/Postgres.php
@@ -6,7 +6,17 @@ use PDO;
use Core\Security;
use Model\Link;
-const VERSION = 66;
+const VERSION = 67;
+
+function version_67($pdo)
+{
+ $pdo->exec("
+ CREATE TABLE plugin_schema_versions (
+ plugin VARCHAR(80) NOT NULL PRIMARY KEY,
+ version INTEGER NOT NULL DEFAULT 0
+ )
+ ");
+}
function version_66($pdo)
{
diff --git a/app/Schema/Sqlite.php b/app/Schema/Sqlite.php
index 8efa016c..16fe0649 100644
--- a/app/Schema/Sqlite.php
+++ b/app/Schema/Sqlite.php
@@ -6,7 +6,17 @@ use Core\Security;
use PDO;
use Model\Link;
-const VERSION = 82;
+const VERSION = 83;
+
+function version_83($pdo)
+{
+ $pdo->exec("
+ CREATE TABLE plugin_schema_versions (
+ plugin TEXT NOT NULL PRIMARY KEY,
+ version INTEGER NOT NULL DEFAULT 0
+ )
+ ");
+}
function version_82($pdo)
{