Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2885 Fix MySQL8.4 nonstandard foreign keys deprecation #2946

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions schema/mysql-migrations/upgrade_188.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ALTER TABLE director_activity_log
DROP INDEX checksum,
ADD UNIQUE INDEX checksum (checksum);

ALTER TABLE director_generated_config
ADD CONSTRAINT director_generated_config_activity
FOREIGN KEY (last_activity_checksum)
REFERENCES director_activity_log (checksum)
ON DELETE RESTRICT
ON UPDATE RESTRICT;

INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (188, NOW());
6 changes: 3 additions & 3 deletions schema/mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ CREATE TABLE director_activity_log (
INDEX search_idx (object_name),
INDEX search_idx2 (object_type(32), object_name(64), change_time),
INDEX search_author (author),
INDEX checksum (checksum)
UNIQUE INDEX checksum (checksum)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE director_activity_log_remark (
Expand Down Expand Up @@ -114,7 +114,7 @@ CREATE TABLE director_generated_config (
last_activity_checksum VARBINARY(20) NOT NULL,
PRIMARY KEY (checksum),
CONSTRAINT director_generated_config_activity
FOREIGN KEY activity_checksum (last_activity_checksum)
FOREIGN KEY (last_activity_checksum)
REFERENCES director_activity_log (checksum)
ON DELETE RESTRICT
ON UPDATE RESTRICT
Expand Down Expand Up @@ -2446,4 +2446,4 @@ CREATE TABLE branched_icinga_dependency (

INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (187, NOW());
VALUES (188, NOW());