web/DuneQuests/schema.sql
unimatrixgit 77cdf19faa Checkpoint Alpha 1.0.0.3 graphical menus and moderation evidence
Preserve the current Alpha source and artwork snapshot. See handoff/alpha-1.0.0.3 for actual deployed hashes, checks, staged follow-ups and the production pause. This checkpoint does not claim every source feature is deployed.
2026-11-02 00:05:34 +01:00

3 lines
1.7 KiB
SQL

CREATE TABLE IF NOT EXISTS dune_quest_definitions(quest_key VARCHAR(64) PRIMARY KEY,title VARCHAR(120) NOT NULL,description TEXT NOT NULL,engine VARCHAR(32) NOT NULL DEFAULT 'worm-survival',enabled BOOLEAN NOT NULL DEFAULT TRUE,hidden BOOLEAN NOT NULL DEFAULT TRUE,interval_seconds INT NOT NULL,survive_seconds INT NOT NULL,reward_dunemarks BIGINT NOT NULL DEFAULT 0,version INT NOT NULL DEFAULT 1,next_run_at BIGINT NOT NULL,updated_at BIGINT NOT NULL,updated_by VARCHAR(64) NOT NULL,CONSTRAINT dune_quest_reward_zero CHECK(reward_dunemarks=0),CONSTRAINT dune_quest_interval_bounds CHECK(interval_seconds BETWEEN 3600 AND 604800),CONSTRAINT dune_quest_survive_bounds CHECK(survive_seconds BETWEEN 60 AND 1800)) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS dune_quest_events(id VARCHAR(36) PRIMARY KEY,definition_key VARCHAR(64) NOT NULL,definition_version INT NOT NULL,player_uuid VARCHAR(36),server_id VARCHAR(32) NOT NULL,status VARCHAR(20) NOT NULL,assigned_at BIGINT NOT NULL,deadline_at BIGINT,completed_at BIGINT,worm_uuid VARCHAR(36),reason VARCHAR(500) NOT NULL DEFAULT '',title_snapshot VARCHAR(120) NOT NULL,description_snapshot TEXT NOT NULL,INDEX dune_quest_player(player_uuid,assigned_at),INDEX dune_quest_active(status,server_id),FOREIGN KEY(definition_key) REFERENCES dune_quest_definitions(quest_key)) ENGINE=InnoDB;
INSERT IGNORE INTO dune_quest_definitions(quest_key,title,description,interval_seconds,survive_seconds,next_run_at,updated_at,updated_by) VALUES('buried-thunder','Buried Thunder','An immense sandworm has found your trail. Survive the encounter or defeat it.',3600,300,CAST(UNIX_TIMESTAMP(CURRENT_TIMESTAMP(3))*1000 AS SIGNED)+3600000,CAST(UNIX_TIMESTAMP(CURRENT_TIMESTAMP(3))*1000 AS SIGNED),'system');