diff --git a/src/main/resources/db/120/V1000_89__ongeki_event_map_unique.sql b/src/main/resources/db/120/V1000_89__ongeki_event_map_unique.sql index 19a74856..4d021d4e 100644 --- a/src/main/resources/db/120/V1000_89__ongeki_event_map_unique.sql +++ b/src/main/resources/db/120/V1000_89__ongeki_event_map_unique.sql @@ -1,3 +1,10 @@ +-- should have been not nullable in the first place smh +DELETE FROM ongeki_user_event_map +WHERE user_id IS NULL; + +ALTER TABLE ongeki_user_event_map + MODIFY user_id BIGINT NOT NULL; + -- dedupe before adding new constraint just in case DELETE FROM ongeki_user_event_map WHERE id NOT IN ( diff --git a/src/main/resources/db/120/V1000_90__ongeki_event_music_level_unique.sql b/src/main/resources/db/120/V1000_90__ongeki_event_music_level_unique.sql index 2f1d9710..4696bbb9 100644 --- a/src/main/resources/db/120/V1000_90__ongeki_event_music_level_unique.sql +++ b/src/main/resources/db/120/V1000_90__ongeki_event_music_level_unique.sql @@ -1,7 +1,13 @@ -- allow separate Technical Challenge records for each chart difficulty -- drop the old constraint and dedupe with the new constraint just in case again ALTER TABLE ongeki_user_event_music - DROP INDEX UKo5PU3BgZeTKB8SNykq9U7xjfshp; + DROP INDEX IF EXISTS UKo5PU3BgZeTKB8SNykq9U7xjfshp; + +DELETE FROM ongeki_user_event_music +WHERE user_id IS NULL; + +ALTER TABLE ongeki_user_event_music + MODIFY user_id BIGINT NOT NULL; DELETE FROM ongeki_user_event_music WHERE id NOT IN (