Guild Text Content
Rich text content for guild info sections (MOTD, rules, loot rules, etc.).
Storage Format
- Content: TipTap/ProseMirror JSON document (not HTML)
- Versioning: Each update increments
versionand appends toGuildTextContentHistory
Schema
model GuildTextContent {
id String @id @default(uuid())
guildId String @map("guild_id")
type GuildTextContentType
content Json // TipTap/ProseMirror JSON
version Int @default(1)
updatedAt DateTime @map("updated_at")
updatedBy String? @map("updated_by")
guild Guild @relation(...)
history GuildTextContentHistory[]
}
model GuildTextContentHistory {
id String @id
guildTextContentId String
content Json
version Int
createdAt DateTime
createdBy String?
}
Content Types
motd- Message of the Dayrules- Guild Rulesloot_rules- Loot Rulesraid_expectations- Raid Expectationstrial_info- Trial Informationrecruiting- Recruiting
Frontend
- RichTextEditor: Uses
getJSON()/setContent(json)— stores TipTap JSON - RichTextDisplay: Uses
generateHTML()to render JSON; includesunwrapMigratedHtml()for legacy content that was migrated from HTML (wrapped in a text node)
Migration from HTML
The 20260216025258 migration converted existing HTML to JSON by wrapping it in a paragraph text node. RichTextDisplay detects this format and converts it on-the-fly using generateJSON(). For a one-time DB fix, run a script that uses @tiptap/html's generateJSON() to convert wrapped HTML to proper TipTap JSON.