mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
schema/mysql: object counters for generated files
This commit is contained in:
parent
0c68677fa5
commit
d1d9ebe412
13
schema/mysql-changes/upgrade_56.sql
Normal file
13
schema/mysql-changes/upgrade_56.sql
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
ALTER TABLE director_generated_file
|
||||||
|
ADD COLUMN cnt_object INT(10) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
ADD COLUMN cnt_template INT(10) UNSIGNED NOT NULL DEFAULT 0;
|
||||||
|
|
||||||
|
UPDATE director_generated_file
|
||||||
|
SET cnt_object = ROUND(
|
||||||
|
(LENGTH(content) - LENGTH( REPLACE(content, 'object ', '') ) )
|
||||||
|
/ LENGTH('object ')
|
||||||
|
), cnt_template = ROUND(
|
||||||
|
(LENGTH(content) - LENGTH( REPLACE(content, 'template ', '') ) )
|
||||||
|
/ LENGTH('template ')
|
||||||
|
);
|
||||||
|
|
@ -52,6 +52,8 @@ CREATE TABLE director_generated_config (
|
|||||||
CREATE TABLE director_generated_file (
|
CREATE TABLE director_generated_file (
|
||||||
checksum VARBINARY(20) NOT NULL COMMENT 'SHA1(content)',
|
checksum VARBINARY(20) NOT NULL COMMENT 'SHA1(content)',
|
||||||
content MEDIUMTEXT NOT NULL,
|
content MEDIUMTEXT NOT NULL,
|
||||||
|
cnt_object INT(10) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
cnt_template INT(10) UNSIGNED NOT NULL DEFAULT 0,
|
||||||
PRIMARY KEY (checksum)
|
PRIMARY KEY (checksum)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user