schema/mysql: object counters for generated files
This commit is contained in:
parent
0c68677fa5
commit
d1d9ebe412
|
@ -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 (
|
||||
checksum VARBINARY(20) NOT NULL COMMENT 'SHA1(content)',
|
||||
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)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
|
Loading…
Reference in New Issue