Files
lunar-tear/server/migrations/20260517103753_add_user_labyrinth_state.sql
Ilya Groshev 2cf0c153e1
Build and Push Docker images to Docker Hub / build-and-push (push) Has been cancelled
Implement Fate Boards
2026-05-17 18:21:57 +03:00

24 lines
1.2 KiB
SQL

-- +goose Up
CREATE TABLE user_event_quest_labyrinth_seasons (
user_id INTEGER NOT NULL REFERENCES users(user_id),
event_quest_chapter_id INTEGER NOT NULL,
last_join_season_number INTEGER NOT NULL DEFAULT 0,
last_season_reward_received_season_number INTEGER NOT NULL DEFAULT 0,
latest_version INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (user_id, event_quest_chapter_id)
);
CREATE TABLE user_event_quest_labyrinth_stages (
user_id INTEGER NOT NULL REFERENCES users(user_id),
event_quest_chapter_id INTEGER NOT NULL,
stage_order INTEGER NOT NULL,
is_received_stage_clear_reward INTEGER NOT NULL DEFAULT 0,
accumulation_reward_received_quest_mission_count INTEGER NOT NULL DEFAULT 0,
latest_version INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY (user_id, event_quest_chapter_id, stage_order)
);
-- +goose Down
DROP TABLE IF EXISTS user_event_quest_labyrinth_stages;
DROP TABLE IF EXISTS user_event_quest_labyrinth_seasons;