mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-23 21:01:23 +00:00
Dessalines
ee7df0dc35
- Adds an image_details table, which stores the height, width, and content_type for local and remote images. - For LocalImages, this information already comes back with the upload. - For RemoteImages, it calls the pictrs details endpoint. - Fixed some issues with proxying non-image urls. - Fixes #3328 - Also fixes #4703
15 lines
561 B
SQL
15 lines
561 B
SQL
-- Drop the id column from the remote_image table, just use link
|
|
ALTER TABLE remote_image
|
|
DROP COLUMN id,
|
|
ADD PRIMARY KEY (link),
|
|
DROP CONSTRAINT remote_image_link_key;
|
|
|
|
-- No good way to do references here unfortunately, unless we combine the images tables
|
|
-- The link should be the URL, not the pictrs_alias, to allow joining from post.thumbnail_url
|
|
CREATE TABLE image_details (
|
|
link text PRIMARY KEY,
|
|
width integer NOT NULL,
|
|
height integer NOT NULL,
|
|
content_type text NOT NULL,
|
|
published timestamptz DEFAULT now() NOT NULL
|
|
);
|