mirror of
https://github.com/status-im/status-go.git
synced 2025-01-09 22:26:30 +00:00
d0e0deac95
This introduces a new table to store discord message authors. The main reason this table is being introduce is so that we don't have to duplicate discord message author information in the `user_messages` table when importing discord communities (ongoing work). In addition to the table there are also two new APIs on the messenger persistence layer (which are later used in the import logic): - `HasDiscordMessageAuthor` - `SaveDiscordMessageAuthor` Closes #2759
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.