statbot icon indicating copy to clipboard operation
statbot copied to clipboard

Add message_history table

Open emmiegit opened this issue 6 years ago • 0 comments

The messages table tracks the current state of all messages. However any information in edits is lost. We should add a message_history table with the following schema:

Column Name Type Other
message_id BigInteger Primary key, foreign key messages.message_id
date DateTime Primary key
content UnicodeText
embeds JSON

This way we preserve the existing messages table and also don't duplicate tons of information over several rows. For instance, the message_type or channel_id of a message won't change over edits, and so can be fetched by JOINing on messages.

emmiegit avatar Nov 05 '18 19:11 emmiegit