21 lines
1008 B
SQL
21 lines
1008 B
SQL
-- PORT: battle pass tables (docs/FEATURE-BATTLEPASS.md). Idempotent; run once on the player database.
|
|
-- Progress: one row per player, season and mission slot; the game adds deltas and MySQL caps them at target.
|
|
CREATE TABLE IF NOT EXISTS mt_battlepass_progress (
|
|
pid INT UNSIGNED NOT NULL,
|
|
season INT UNSIGNED NOT NULL,
|
|
slot TINYINT UNSIGNED NOT NULL,
|
|
value BIGINT UNSIGNED NOT NULL DEFAULT 0,
|
|
target BIGINT UNSIGNED NOT NULL DEFAULT 0,
|
|
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
|
PRIMARY KEY (pid, season, slot)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
|
-- Claims: the primary key is the idempotency guard; only the request whose INSERT IGNORE adds the row pays out.
|
|
-- slot 0 is the final reward.
|
|
CREATE TABLE IF NOT EXISTS mt_battlepass_claim (
|
|
pid INT UNSIGNED NOT NULL,
|
|
season INT UNSIGNED NOT NULL,
|
|
slot TINYINT UNSIGNED NOT NULL,
|
|
claimed_at INT UNSIGNED NOT NULL,
|
|
PRIMARY KEY (pid, season, slot)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|