Skip to content

Commit

Permalink
Don't make a new index every single startup!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
xSke committed Feb 15, 2024
1 parent 25f505e commit a417d74
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ create table if not exists images
uploaded_by_account bigint
);

create index on images (original_url);
create index on images (original_attachment_id);
create index on images (uploaded_by_account);
create index if not exists images_original_url_idx on images (original_url);
create index if not exists images_original_attachment_id_idx on images (original_attachment_id);
create index if not exists images_uploaded_by_account_idx on images (uploaded_by_account);

create table if not exists image_queue (itemid serial primary key, url text not null, kind text not null);

alter table images add column if not exists uploaded_by_system uuid;
alter table images add column if not exists uploaded_by_system uuid;
alter table images add column if not exists content_type text default 'image/webp';

0 comments on commit a417d74

Please sign in to comment.