Currently when we process uploads or receive incoming media we only store a url for that media.
So for instance for accounts, we store:
For media, we store:
- type
- url
- width
- height
- thumbnail_type
- thumbnail_url
- thumbnail_width
- thumbnail_height
For custom emojis, we store:
Given these properties, it's not possible to know whether the media is stored in our uploads (s3 / fs) or whether the media comes from a remote source. Additionally, if it is stored in our uploads, we don't store the key for the file, which is necessary when performing deletions of uploaded files.
We probably want to move towards a schema like:
- avatar_key (nullable)
- avatar_remote_url (nullable)
Where _key refers to the file in our storage, and _remote_url is for media stored on other servers.
Currently when we process uploads or receive incoming media we only store a
urlfor that media.So for instance for accounts, we store:
For media, we store:
For custom emojis, we store:
Given these properties, it's not possible to know whether the media is stored in our uploads (s3 / fs) or whether the media comes from a remote source. Additionally, if it is stored in our uploads, we don't store the
keyfor the file, which is necessary when performing deletions of uploaded files.We probably want to move towards a schema like:
Where
_keyrefers to the file in our storage, and_remote_urlis for media stored on other servers.