-
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.
- Loading branch information
1 parent
759519d
commit c7e493d
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/main/resources/db/migration/mariadb/V255_2__fix_null.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,17 @@ | ||
-- maimai2_user_playlog | ||
-- Set ext_bool1 as NOT NULL and give it a default value (e.g., FALSE) | ||
UPDATE maimai2_user_playlog SET ext_bool1 = FALSE WHERE ext_bool1 IS NULL; | ||
ALTER TABLE maimai2_user_playlog MODIFY COLUMN ext_bool1 BOOLEAN NOT NULL DEFAULT FALSE; | ||
|
||
-- Set ext_num4 as NOT NULL (assuming it already has a default value of 0) | ||
UPDATE maimai2_user_playlog SET ext_num4 = 0 WHERE ext_num4 IS NULL; | ||
ALTER TABLE maimai2_user_playlog MODIFY COLUMN ext_num4 INTEGER NOT NULL DEFAULT 0; | ||
|
||
-- maimai2_user_detail | ||
-- Add default value for current_play_count and set it as NOT NULL | ||
UPDATE maimai2_user_detail SET current_play_count = 0 WHERE current_play_count IS NULL; | ||
ALTER TABLE maimai2_user_detail MODIFY COLUMN current_play_count INTEGER NOT NULL DEFAULT 0; | ||
|
||
-- Add default value for rename_credit and set it as NOT NULL | ||
UPDATE maimai2_user_detail SET rename_credit = 0 WHERE rename_credit IS NULL; | ||
ALTER TABLE maimai2_user_detail MODIFY COLUMN rename_credit INTEGER NOT NULL DEFAULT 0; |
17 changes: 17 additions & 0 deletions
17
src/main/resources/db/migration/mysql/V255_2__fix_null.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,17 @@ | ||
-- maimai2_user_playlog | ||
-- Set ext_bool1 as NOT NULL and give it a default value (e.g., FALSE) | ||
UPDATE maimai2_user_playlog SET ext_bool1 = FALSE WHERE ext_bool1 IS NULL; | ||
ALTER TABLE maimai2_user_playlog MODIFY COLUMN ext_bool1 BOOLEAN NOT NULL DEFAULT FALSE; | ||
|
||
-- Set ext_num4 as NOT NULL (assuming it already has a default value of 0) | ||
UPDATE maimai2_user_playlog SET ext_num4 = 0 WHERE ext_num4 IS NULL; | ||
ALTER TABLE maimai2_user_playlog MODIFY COLUMN ext_num4 INTEGER NOT NULL DEFAULT 0; | ||
|
||
-- maimai2_user_detail | ||
-- Add default value for current_play_count and set it as NOT NULL | ||
UPDATE maimai2_user_detail SET current_play_count = 0 WHERE current_play_count IS NULL; | ||
ALTER TABLE maimai2_user_detail MODIFY COLUMN current_play_count INTEGER NOT NULL DEFAULT 0; | ||
|
||
-- Add default value for rename_credit and set it as NOT NULL | ||
UPDATE maimai2_user_detail SET rename_credit = 0 WHERE rename_credit IS NULL; | ||
ALTER TABLE maimai2_user_detail MODIFY COLUMN rename_credit INTEGER NOT NULL DEFAULT 0; |
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,3 @@ | ||
UPDATE maimai2_user_playlog SET ext_bool1=false; | ||
UPDATE maimai2_user_detail SET current_play_count=0; | ||
UPDATE maimai2_user_detail SET rename_credit=0; |