mirror of
https://github.com/sysadminsmedia/homebox.git
synced 2025-12-24 22:39:14 +01:00
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: tonya <tonya@tokia.dev>
35 lines
1.1 KiB
SQL
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; |