Prepares the chat's @everyone: it adds chat_messages.mentions_everyone, and frees the name everyone, which no account may have any more.

Functions

f
up(db: DatabaseSync): void

Run once by runMigrations. The messages that a moderator or an admin already sent with @everyone get the flag, so that editing one later doesn't notify everyone of an old message; none is notified now. A user named everyone, in any case, is renamed to the first free everyone_2, everyone_3…, with no alias left behind, and an alias everyone is dropped. Both are logged.

Usage

import * as mod from "api/db/migrations/0023_mention_everyone.ts";