Files
amcs/migrations/_old/016_create_stored_files.sql
Hein 927a118338
Some checks failed
CI / build-and-test (push) Failing after -31m53s
feat(ui): add maintenance page for task management
* Implement maintenance page with task and log display
* Add backfill and metadata retry functionality
* Integrate grid component for project display in thoughts page
* Update types for maintenance tasks and logs
* Enhance sidebar and shell for new maintenance navigation
2026-04-26 23:13:41 +02:00

21 lines
961 B
SQL

create table if not exists stored_files (
id bigserial primary key,
guid uuid not null default gen_random_uuid(),
thought_id uuid references thoughts(guid) on delete set null,
project_id uuid references projects(guid) on delete set null,
name text not null,
media_type text not null,
kind text not null default 'file',
encoding text not null default 'base64',
size_bytes bigint not null,
sha256 text not null,
content bytea not null,
created_at timestamptz not null default now(),
updated_at timestamptz not null default now(),
constraint stored_files_guid_unique unique (guid)
);
create index if not exists stored_files_thought_id_idx on stored_files (thought_id);
create index if not exists stored_files_project_id_idx on stored_files (project_id);
create index if not exists stored_files_sha256_idx on stored_files (sha256);