-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cea1bde
commit 73c59c0
Showing
2 changed files
with
12 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
src/main/resources/db/migration/V60__alter_search_keywords_and_ip_map_unique_cascade.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ALTER TABLE `article_search_keywords` | ||
MODIFY COLUMN `keyword` VARCHAR(255) NOT NULL UNIQUE; | ||
|
||
ALTER TABLE article_search_keyword_ip_map | ||
ADD CONSTRAINT unique_keyword_ip UNIQUE (keyword_id, ip_address), | ||
ADD CONSTRAINT fk_keyword_id | ||
FOREIGN KEY (keyword_id) | ||
REFERENCES article_search_keywords (id) | ||
ON DELETE CASCADE; |