From 656f39b9db9d9df9ea5024b159d0733b1d0b2df4 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 29 Jun 2022 15:50:45 +0200 Subject: [PATCH] mysql: Add table `icingaweb_schema` Co-authored-by: Eric Lippmann --- etc/schema/mysql-upgrades/2.11.0.sql | 11 +++++++++++ etc/schema/mysql.schema.sql | 13 ++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/etc/schema/mysql-upgrades/2.11.0.sql b/etc/schema/mysql-upgrades/2.11.0.sql index d55d563d7..834cb9490 100644 --- a/etc/schema/mysql-upgrades/2.11.0.sql +++ b/etc/schema/mysql-upgrades/2.11.0.sql @@ -14,3 +14,14 @@ ALTER TABLE `icingaweb_user_preference` MODIFY COLUMN `username` varchar(254) COLLATE utf8mb4_unicode_ci NOT NULL, MODIFY COLUMN `section` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL, MODIFY COLUMN `name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL; + +CREATE TABLE icingaweb_schema ( + id int unsigned NOT NULL AUTO_INCREMENT, + version smallint unsigned NOT NULL, + timestamp int unsigned NOT NULL, + + PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; + +INSERT INTO icingaweb_schema (version, timestamp) + VALUES (6, UNIX_TIMESTAMP()); diff --git a/etc/schema/mysql.schema.sql b/etc/schema/mysql.schema.sql index 18d9b2b83..1b0f99136 100644 --- a/etc/schema/mysql.schema.sql +++ b/etc/schema/mysql.schema.sql @@ -1,4 +1,4 @@ -# Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ +# Icinga Web 2 | (c) 2014 Icinga GmbH | GPLv2+ CREATE TABLE `icingaweb_group`( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, @@ -52,3 +52,14 @@ CREATE TABLE `icingaweb_rememberme`( mtime timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; + +CREATE TABLE icingaweb_schema ( + id int unsigned NOT NULL AUTO_INCREMENT, + version smallint unsigned NOT NULL, + timestamp int unsigned NOT NULL, + + PRIMARY KEY (id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; + +INSERT INTO icingaweb_schema (version, timestamp) + VALUES (6, UNIX_TIMESTAMP());