mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-25 22:22:48 +00:00
feat(mail): keep mail a player deletes, marked deleted, for staff
Deleting mail in game now sets mail.deleted_at (migrations mysql 95, sqlite 78) instead of removing the row. Every read for the game skips deleted mail: the mailbox, a single mail (claim, read, delete), the unread count, the economy scan of waiting attachments and the UGC lookup of mailed models. Deleting a character still removes its mail. Check: delete a mail in game; it leaves the mailbox, the unread count drops, and the row is still in the mail table with deleted_at set. Parity test: ParitySeeded.Mail (DeleteMail). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
7
migrations/dlu/mysql/95_mail_deleted_at.sql
Normal file
7
migrations/dlu/mysql/95_mail_deleted_at.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
/* mail.deleted_at: when the player deleted the mail in game (unix time; 0 = not deleted). Deleted mail stays for staff
|
||||
to read on the dashboard; the game never shows it again. */
|
||||
SET @dlu_column = (SELECT IF(COUNT(*) = 0, 'ALTER TABLE mail ADD COLUMN deleted_at BIGINT NOT NULL DEFAULT 0', 'DO 0') FROM information_schema.columns
|
||||
WHERE table_schema = DATABASE() AND table_name = 'mail' AND column_name = 'deleted_at');
|
||||
PREPARE dlu_column_stmt FROM @dlu_column;
|
||||
EXECUTE dlu_column_stmt;
|
||||
DEALLOCATE PREPARE dlu_column_stmt;
|
||||
2
migrations/dlu/sqlite/78_mail_deleted_at.sql
Normal file
2
migrations/dlu/sqlite/78_mail_deleted_at.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
/* mail.deleted_at: when the player deleted the mail in game. See the MySQL migration. */
|
||||
ALTER TABLE mail ADD COLUMN deleted_at BIGINT NOT NULL DEFAULT 0;
|
||||
Reference in New Issue
Block a user