schema/mysql: more checksums for more history voodoo

This commit is contained in:
Thomas Gelf 2016-02-27 18:13:21 +01:00
parent 86f8830bcf
commit e64e72cb52
2 changed files with 17 additions and 1 deletions

View File

@ -0,0 +1,14 @@
ALTER TABLE director_generated_config
ADD COLUMN first_activity_checksum VARBINARY(20) NOT NULL AFTER duration;
UPDATE director_generated_config SET first_activity_checksum = last_activity_checksum;
ALTER TABLE director_deployment_log
ADD COLUMN last_activity_checksum VARBINARY(20) NOT NULL AFTER config_checksum;
UPDATE director_deployment_log l JOIN director_generated_config c ON l.config_checksum = c.checksum SET l.last_activity_checksum = c.last_activity_checksum;
INSERT INTO director_schema_migration
SET migration_time = NOW(),
schema_version = 72;

View File

@ -32,6 +32,7 @@ CREATE TABLE director_generated_config (
director_version VARCHAR(64) DEFAULT NULL,
director_db_version INT(10) DEFAULT NULL,
duration INT(10) UNSIGNED DEFAULT NULL COMMENT 'Config generation duration (ms)',
first_activity_checksum VARBINARY(20) NOT NULL,
last_activity_checksum VARBINARY(20) NOT NULL,
PRIMARY KEY (checksum),
CONSTRAINT director_generated_config_activity
@ -70,6 +71,7 @@ CREATE TABLE director_generated_config_file (
CREATE TABLE director_deployment_log (
id BIGINT(20) UNSIGNED AUTO_INCREMENT NOT NULL,
config_checksum VARBINARY(20) DEFAULT NULL,
last_activity_checksum VARBINARY(20) NOT NULL,
peer_identity VARCHAR(64) NOT NULL,
start_time DATETIME NOT NULL,
end_time DATETIME DEFAULT NULL,
@ -1110,4 +1112,4 @@ CREATE TABLE sync_run (
INSERT INTO director_schema_migration
SET migration_time = NOW(),
schema_version = 71;
schema_version = 72;