Files
AzerothAI/deploy/classic/schema.sql
T
2026-09-25 18:19:50 -07:00

50 lines
1.9 KiB
SQL

-- Apply only to the isolated Classic character database.
CREATE TABLE IF NOT EXISTS azerothai_roster (
guid INT UNSIGNED PRIMARY KEY,
account_id INT UNSIGNED NOT NULL,
name VARCHAR(12) NOT NULL UNIQUE,
enabled BOOLEAN NOT NULL DEFAULT FALSE,
plot_armor BOOLEAN NOT NULL DEFAULT FALSE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS azerothai_commands (
id VARCHAR(36) PRIMARY KEY,
guid INT UNSIGNED NOT NULL,
account_id INT UNSIGNED NOT NULL,
name VARCHAR(12) NOT NULL,
kind VARCHAR(20) NOT NULL,
argument TEXT NOT NULL,
peer_guid INT UNSIGNED NOT NULL DEFAULT 0,
peer_account_id INT UNSIGNED NOT NULL DEFAULT 0,
peer_name VARCHAR(12) NOT NULL DEFAULT '',
expires_at BIGINT UNSIGNED NOT NULL,
created_at BIGINT UNSIGNED NOT NULL,
status VARCHAR(16) NOT NULL DEFAULT 'pending',
result TEXT,
delivered BOOLEAN NOT NULL DEFAULT FALSE,
INDEX pending (status,created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS azerothai_snapshots (
guid INT UNSIGNED PRIMARY KEY,
at BIGINT UNSIGNED NOT NULL,
payload MEDIUMTEXT NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS azerothai_events (
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
at BIGINT UNSIGNED NOT NULL,
kind VARCHAR(100) NOT NULL,
payload TEXT NOT NULL,
delivered BOOLEAN NOT NULL DEFAULT FALSE,
INDEX delivery (delivered,id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS azerothai_counters (
guid INT UNSIGNED PRIMARY KEY,
quests BIGINT UNSIGNED NOT NULL DEFAULT 0,
rewarded BIGINT UNSIGNED NOT NULL DEFAULT 0,
lootEvents BIGINT UNSIGNED NOT NULL DEFAULT 0,
lootItems BIGINT UNSIGNED NOT NULL DEFAULT 0,
lootedCopper BIGINT UNSIGNED NOT NULL DEFAULT 0,
nativeDeaths BIGINT UNSIGNED NOT NULL DEFAULT 0,
learnedSpells BIGINT UNSIGNED NOT NULL DEFAULT 0,
resurrections BIGINT UNSIGNED NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;