Schema: Update timestamp & set success of existing schema version entry
This commit is contained in:
parent
ac24c6d34b
commit
80ac314d8b
|
@ -6,6 +6,8 @@ ALTER TABLE icingaweb_schema
|
|||
DROP CONSTRAINT IF EXISTS idx_icingaweb_schema_version,
|
||||
ADD CONSTRAINT idx_icingaweb_schema_version UNIQUE (version);
|
||||
|
||||
UPDATE icingaweb_schema SET timestamp = timestamp * 1000, success = 'y';
|
||||
|
||||
INSERT INTO icingaweb_schema (version, timestamp, success, reason)
|
||||
VALUES('2.12.0', UNIX_TIMESTAMP() * 1000, 'y', NULL)
|
||||
ON DUPLICATE KEY UPDATE timestamp = VALUES(timestamp), success = VALUES(success), reason = VALUES(reason);
|
||||
|
|
|
@ -8,6 +8,8 @@ ALTER TABLE icingaweb_schema
|
|||
DROP CONSTRAINT IF EXISTS idx_icingaweb_schema_version,
|
||||
ADD CONSTRAINT idx_icingaweb_schema_version UNIQUE (version);
|
||||
|
||||
UPDATE icingaweb_schema SET timestamp = timestamp * 1000, success = 'y';
|
||||
|
||||
INSERT INTO icingaweb_schema (version, timestamp, success, reason)
|
||||
VALUES('2.12.0', EXTRACT(EPOCH FROM now()) * 1000, 'y', NULL)
|
||||
ON CONFLICT ON CONSTRAINT idx_icingaweb_schema_version DO UPDATE SET timestamp = EXCLUDED.timestamp, success = EXCLUDED.success, reason = EXCLUDED.reason;
|
||||
|
|
Loading…
Reference in New Issue