mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-05-06 14:24:15 +02:00
Brings 53 develop commits (i18n, Diva, campaign, guild invites, save transfer, return/rookie guilds, hunting tournament, JSON quest/scenario loaders, Ghidra-derived user binary parsing, and misc fixes) onto main now that 9.3.2 has been tagged and released. Resolves two overlap zones: 1. Migration number collision. Main shipped 0010_fix_zero_rasta_id and 0011_fix_stale_boost_time in 9.3.2; develop had independently numbered 0010_campaign..0015_tournament. The migration runner keys applied versions by integer, so coexisting files with the same numeric prefix would silently skip each other. Develop's files have been renumbered to 0016..0021, leaving main's 0010/0011 intact. A schema_version rename script is required on any server that had already applied the old develop numbers (only frontier.mogapedia.fr at the time of this merge). 2. CHANGELOG.md. Develop's in-progress feature entries move into [Unreleased] with updated migration references; the [9.3.2] section is preserved verbatim. main.go version string bumped to 9.4.0-dev to mark the new cycle. Full test suite (go test -race ./...) passes.
45 lines
1.6 KiB
SQL
45 lines
1.6 KiB
SQL
CREATE TABLE IF NOT EXISTS tournaments (
|
|
id SERIAL PRIMARY KEY,
|
|
name VARCHAR(64) NOT NULL,
|
|
start_time BIGINT NOT NULL,
|
|
entry_end BIGINT NOT NULL,
|
|
ranking_end BIGINT NOT NULL,
|
|
reward_end BIGINT NOT NULL
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS tournament_cups (
|
|
id SERIAL PRIMARY KEY,
|
|
tournament_id INTEGER NOT NULL REFERENCES tournaments(id) ON DELETE CASCADE,
|
|
cup_group SMALLINT NOT NULL,
|
|
cup_type SMALLINT NOT NULL,
|
|
unk SMALLINT NOT NULL DEFAULT 0,
|
|
name VARCHAR(64) NOT NULL,
|
|
description TEXT NOT NULL DEFAULT ''
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS tournament_sub_events (
|
|
id SERIAL PRIMARY KEY,
|
|
cup_group SMALLINT NOT NULL,
|
|
event_sub_type SMALLINT NOT NULL DEFAULT 0,
|
|
quest_file_id INTEGER NOT NULL DEFAULT 0,
|
|
name VARCHAR(64) NOT NULL
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS tournament_entries (
|
|
id SERIAL PRIMARY KEY,
|
|
char_id INTEGER NOT NULL REFERENCES characters(id) ON DELETE CASCADE,
|
|
tournament_id INTEGER NOT NULL REFERENCES tournaments(id) ON DELETE CASCADE,
|
|
registered_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
UNIQUE (char_id, tournament_id)
|
|
);
|
|
|
|
CREATE TABLE IF NOT EXISTS tournament_results (
|
|
id SERIAL PRIMARY KEY,
|
|
char_id INTEGER NOT NULL REFERENCES characters(id) ON DELETE CASCADE,
|
|
tournament_id INTEGER NOT NULL REFERENCES tournaments(id) ON DELETE CASCADE,
|
|
event_id INTEGER NOT NULL,
|
|
quest_slot INTEGER NOT NULL DEFAULT 0,
|
|
stage_handle INTEGER NOT NULL DEFAULT 0,
|
|
submitted_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
);
|