Files
homebox/backend/internal/data/migrations/sqlite3/20250619215150_add_thumbnails.sql
Matt 989100d299 Thumbnails (#797)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: tonya <tonya@tokia.dev>
2025-06-22 21:32:48 -04:00

35 lines
1.1 KiB
SQL

-- +goose Up
create table attachments_dg_tmp
(
id uuid not null
primary key,
created_at datetime not null,
updated_at datetime not null,
type text default 'attachment' not null,
"primary" bool default false not null,
path text not null,
title text not null,
item_attachments uuid
constraint attachments_items_attachments
references items
on delete cascade,
attachment_thumbnail uuid
constraint attachments_attachments_thumbnail
references attachments
);
insert into attachments_dg_tmp(id, created_at, updated_at, type, "primary", path, title, item_attachments)
select id,
created_at,
updated_at,
type,
"primary",
path,
title,
item_attachments
from attachments;
drop table attachments;
alter table attachments_dg_tmp
rename to attachments;