Lets a chat message reply to another, through chat_messages.reply_to_id. The column has no foreign key on purpose: when the replied-to message is deleted, the id stays and chat-service's join reads null, so the chat shows "deleted message" where the quote was.

Functions

f
up(db: DatabaseSync): void

Run once by runMigrations. Existing messages reply to nothing, and a database made from schema.sql already has the column.

Usage

import * as mod from "api/db/migrations/0009_chat_reply.ts";