Pascal Precht 081974da1e feat: add discord_messages table and persistence APIs
This adds a new `discord_messages` table and extends the persistence
APIs such that `MessagesByID` and `MessageByID` will return user
messages that include their discord message payload.

It also adds APIs to save individual discord messages.
2022-08-11 10:49:23 +02:00
..
2020-01-10 19:59:01 +01:00
2020-01-10 19:59:01 +01:00
2020-04-16 15:51:28 +02:00
2021-01-08 08:43:16 +01:00

How to write migrations?

We only write up migrations, down migrations are not always possible in sqlite or too complex/too expensive. For example to remove a column you would have to duplicate the table, copy over the data, delete and recreated. This can be very expensive for some tables (user_messages for example), so should not be attempted.

Notes

One issue we faced multiple times is that updates to user_messages can be very expensive, leading to slow upgrade times and interrupted migrations. So avoid writes if not necessary.