[ongeki] fix chapter jewel not saved

master
shenjiayi 2020-08-26 15:52:48 +08:00
parent 8feed030f6
commit ecf91763a6
3 changed files with 49 additions and 0 deletions

View File

@ -34,6 +34,14 @@ public class UserStory implements Serializable {
private int lastChapterId;
private int jewelCount;
private int lastPlayMusicId;
private int lastPlayMusicCategory;
private int lastPlayMusicLevel;
public UserStory(UserData userData) {
this.user = userData;
}

View File

@ -0,0 +1,5 @@
ALTER TABLE `ongeki_user_story`
ADD COLUMN `jewel_count` int(11),
ADD COLUMN `last_play_music_id` int(11),
ADD COLUMN `last_play_music_category` int(11),
ADD COLUMN `last_play_music_level` int(11);

View File

@ -0,0 +1,36 @@
PRAGMA foreign_keys = 0;
CREATE TABLE ongeki_user_story_new (
id INTEGER,
last_chapter_id INTEGER NOT NULL,
story_id INTEGER NOT NULL,
jewel_count INTEGER,
last_play_music_id INTEGER,
last_play_music_category INTEGER,
last_play_music_level INTEGER,
user_id BIGINT REFERENCES ongeki_user_data (id) ON DELETE CASCADE,
PRIMARY KEY (
id
),
CONSTRAINT ongeki_user_story_uq UNIQUE (
story_id,
user_id
) ON CONFLICT REPLACE
);
INSERT INTO ongeki_user_story_new (
id,
last_chapter_id,
story_id,
user_id
)
SELECT id,
last_chapter_id,
story_id,
user_id
FROM ongeki_user_story;
ALTER TABLE ongeki_user_story RENAME TO bak_ongeki_user_story;
ALTER TABLE ongeki_user_story_new RENAME TO ongeki_user_story;
PRAGMA foreign_keys = 1;