summaryrefslogtreecommitdiff
path: root/app/Schema/Postgres.php
diff options
context:
space:
mode:
authorLesstat <florianbarth@gmx.de>2015-07-11 11:44:26 +0200
committerLesstat <florianbarth@gmx.de>2015-07-11 11:44:26 +0200
commita85a1c613239c20fe72eb96c2921f4c220ec156b (patch)
treed032b4591e518cbbbfaa8886f8f5d98a6ea2efb7 /app/Schema/Postgres.php
parent5101eaa8060ce3c75a81a26f6e47aae40e3d4ac3 (diff)
parent7e94d0ca233d15d6124c0adf3f956a119c82ccae (diff)
Merged branch 'master' of https://github.com/fguillot/kanboard
only imports conflicted
Diffstat (limited to 'app/Schema/Postgres.php')
-rw-r--r--app/Schema/Postgres.php26
1 files changed, 25 insertions, 1 deletions
diff --git a/app/Schema/Postgres.php b/app/Schema/Postgres.php
index a3309068..fca87766 100644
--- a/app/Schema/Postgres.php
+++ b/app/Schema/Postgres.php
@@ -6,7 +6,31 @@ use PDO;
use Core\Security;
use Model\Link;
-const VERSION = 57;
+const VERSION = 59;
+
+function version_59($pdo)
+{
+ $pdo->exec("
+ CREATE TABLE project_daily_stats (
+ id SERIAL PRIMARY KEY,
+ day CHAR(10) NOT NULL,
+ project_id INTEGER NOT NULL,
+ avg_lead_time INTEGER NOT NULL DEFAULT 0,
+ avg_cycle_time INTEGER NOT NULL DEFAULT 0,
+ FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE
+ )
+ ");
+
+ $pdo->exec('CREATE UNIQUE INDEX project_daily_stats_idx ON project_daily_stats(day, project_id)');
+
+ $pdo->exec('ALTER TABLE project_daily_summaries RENAME TO project_daily_column_stats');
+}
+
+function version_58($pdo)
+{
+ $pdo->exec("ALTER TABLE project_integrations ADD COLUMN slack_webhook_channel VARCHAR(255) DEFAULT ''");
+ $pdo->exec("INSERT INTO settings VALUES ('integration_slack_webhook_channel', '')");
+}
function version_57($pdo)
{