Files
DarkflameServer/migrations/dlu/mysql/100_chat_log_scope.sql
Aaron Kimbrell af54ca282f feat(db): chat log guild, team and filter result; chat flags
chat_log gets guild_id, team_id and filtered (migrations mysql 100, sqlite 83),
and the chat log queries take a time range, a guild, a team, a conversation
between two characters and paging back by id. Whispers are their own visibility
switch (includeWhispers), apart from team and guild chat (includePrivate).
Whisper partners and teams that talked are listed with counts.

chat_flags, chat_flag_messages and chat_flag_events (mysql 101, sqlite 84) hold
flagged chat with a copy of the messages around it, its status, note, linked
player report and history. Open flags are in the dashboard snapshot.

Tests on SQLite alone (dDatabaseSqliteTests) and in the MySQL parity tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 18:23:22 -05:00

11 lines
782 B
SQL

/* Where a chat message went, for the guild and team chat histories: guild_id (channel guild) is guilds.id, team_id
(channel team) is the chat server's team, unique across chat server restarts. filtered: the chat filter found words it
doesn't allow. Zone chat that is filtered is also blocked (nobody saw it); whispers, team and guild chat are delivered
either way, so filtered only records what the filter thought of them. */
ALTER TABLE chat_log ADD COLUMN guild_id BIGINT NOT NULL DEFAULT 0;
ALTER TABLE chat_log ADD COLUMN team_id BIGINT NOT NULL DEFAULT 0;
ALTER TABLE chat_log ADD COLUMN filtered TINYINT NOT NULL DEFAULT 0;
UPDATE chat_log SET filtered = blocked;
CREATE INDEX chat_log_guild ON chat_log (guild_id);
CREATE INDEX chat_log_team ON chat_log (team_id);