Skip to content

Commit

Permalink
#2885 Clean up query
Browse files Browse the repository at this point in the history
  • Loading branch information
mcsken committed Dec 20, 2024
1 parent 7bc443c commit 6214ed0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 4 additions & 3 deletions schema/mysql-migrations/upgrade_188.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
ALTER TABLE director_activity_log
ADD UNIQUE INDEX idx_checksum (checksum);
DROP INDEX checksum,
ADD UNIQUE INDEX checksum (checksum);

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

Expand Down
8 changes: 3 additions & 5 deletions schema/mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +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 idx_checksum (checksum)
UNIQUE INDEX checksum (checksum)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE director_activity_log_remark (
Expand Down Expand Up @@ -114,10 +113,9 @@ CREATE TABLE director_generated_config (
first_activity_checksum VARBINARY(20) NOT NULL,
last_activity_checksum VARBINARY(20) NOT NULL,
PRIMARY KEY (checksum),
INDEX idx_checksum (checksum),
CONSTRAINT fk_director_generated_config_activity
CONSTRAINT director_generated_config_activity
FOREIGN KEY (last_activity_checksum)
REFERENCES director_activity_log(checksum)
REFERENCES director_activity_log (checksum)
ON DELETE RESTRICT
ON UPDATE RESTRICT
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Expand Down

0 comments on commit 6214ed0

Please sign in to comment.