Panel: server map address, map actions queue, guild invitations

This commit is contained in:
Claude committed 2026-09-30 20:13:44 +00:00
1 parent eba2ccfdab
commit 878827625a
7 files changed
+520 -6

No files matched your search

+27
View File
@@ -680,6 +680,33 @@ const MIGRATIONS: &[&str] = &[
r#"
ALTER TABLE game_servers ADD COLUMN economy_group TEXT NOT NULL DEFAULT '';
"#,
// BlueMap: a map address per server, in-game actions triggered from the map, and guild invitations.
r#"
ALTER TABLE game_servers ADD COLUMN map_address TEXT NOT NULL DEFAULT '';
CREATE TABLE server_actions (
id INTEGER PRIMARY KEY AUTOINCREMENT,
server_id INTEGER NOT NULL REFERENCES game_servers(id) ON DELETE CASCADE,
kind TEXT NOT NULL,
from_uuid TEXT NOT NULL DEFAULT '',
from_name TEXT NOT NULL DEFAULT '',
to_uuid TEXT NOT NULL DEFAULT '',
text TEXT NOT NULL DEFAULT '',
created_at TEXT NOT NULL,
taken_at TEXT
);
CREATE INDEX server_actions_pending ON server_actions(server_id, taken_at);
CREATE INDEX server_actions_sender ON server_actions(from_uuid, created_at);
CREATE TABLE guild_invites (
id INTEGER PRIMARY KEY AUTOINCREMENT,
guild_id TEXT NOT NULL REFERENCES guilds(id) ON DELETE CASCADE,
inviter_uuid TEXT NOT NULL,
inviter_name TEXT NOT NULL,
target_uuid TEXT NOT NULL,
status TEXT NOT NULL DEFAULT 'pending',
created_at TEXT NOT NULL
);
CREATE INDEX guild_invites_target ON guild_invites(target_uuid, status);
"#,
];
pub async fn connect(data_dir: &Path) -> Result<SqlitePool> {