-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[O] Fix crash due to duplicate keys in maimai2_user_item
- Loading branch information
1 parent
bb39027
commit 126546a
Showing
3 changed files
with
9 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
src/main/resources/db/migration/mariadb/V250__maimai2_item_integrity.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,4 @@ | ||
# Fixes crashes due to duplicate keys in maimai2_user_item | ||
alter table maimai2_user_item | ||
add constraint maimai2_user_item_pk | ||
unique (item_kind, item_id, user_id); |
4 changes: 4 additions & 0 deletions
4
src/main/resources/db/migration/mysql/V250__maimai2_item_integrity.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,4 @@ | ||
# Fixes crashes due to duplicate keys in maimai2_user_item | ||
alter table maimai2_user_item | ||
add constraint maimai2_user_item_pk | ||
unique (item_kind, item_id, user_id); |
1 change: 1 addition & 0 deletions
1
src/main/resources/db/migration/sqlite/V250__maimai2_item_integrity.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 @@ | ||
CREATE UNIQUE INDEX maimai2_user_item_pk ON maimai2_user_item(item_kind, item_id, user_id); |