In the past we had a 1:many relationship between `messages` and `media` and a 1:1 relationship between `media` and `uploads`.
Now that we've introduced thumbnails for videos, the relationship between `media` and `uploads` is 1:many (well 1:1 or 1:2 for now).
We need some way to encode that multiple `uploads` correspond to the same media. One way to do this would be to introduce a `media` table where each entry corresponds to a `Media` and where the columns look something like `| id | container | uploadID | thumbnailID |`.
Personally I think that would be the cleanest approach since the database schema matches the relationship between messages, media, and uploads in the code.
However, what I previously discussed with @ashoat (and which he previously signed off on) was to encode the relationship between `uploads` for each piece of media in an boject and serialize and store those in the `content` column of the `messages` database.
Here's an example of what the `content` column of the `messages` table will look like in the future:
[image]
Instead of a list of IDs, we have a list of `MediaMessageServerDBContent`s which encode the relationship between entries in the `uploads` table.