summaryrefslogtreecommitdiffstats
path: root/schema/mysql-upgrades/0.10.0.sql
diff options
context:
space:
mode:
Diffstat (limited to 'schema/mysql-upgrades/0.10.0.sql')
-rw-r--r--schema/mysql-upgrades/0.10.0.sql12
1 files changed, 12 insertions, 0 deletions
diff --git a/schema/mysql-upgrades/0.10.0.sql b/schema/mysql-upgrades/0.10.0.sql
new file mode 100644
index 0000000..638135b
--- /dev/null
+++ b/schema/mysql-upgrades/0.10.0.sql
@@ -0,0 +1,12 @@
+CREATE TABLE template (
+ id int(10) unsigned NOT NULL AUTO_INCREMENT,
+ author varchar(255) NOT NULL COLLATE utf8mb4_unicode_ci,
+ name varchar(128) NOT NULL COLLATE utf8mb4_unicode_ci,
+ settings longblob NOT NULL,
+ ctime bigint(20) unsigned NOT NULL,
+ mtime bigint(20) unsigned NOT NULL,
+ PRIMARY KEY(id)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
+
+ALTER TABLE report ADD COLUMN template_id int(10) unsigned NULL DEFAULT NULL AFTER timeframe_id;
+ALTER TABLE report ADD CONSTRAINT report_template FOREIGN KEY (template_id) REFERENCES template (id);