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.
The
messagestable tracks the current state of all messages. However any information in edits is lost. We should add amessage_historytable with the following schema:message_idBigIntegermessages.message_iddateDateTimecontentUnicodeTextembedsJSONThis way we preserve the existing
messagestable and also don't duplicate tons of information over several rows. For instance, themessage_typeorchannel_idof a message won't change over edits, and so can be fetched byJOINing onmessages.