gitdataai/libs/migrate/sql/room_attachment/room_attachment_up_01.sql
ZhenYi b413edccaf refactor(migrate): replace hand-written migrations with SQL-file macro system
Replace individual Rust migration modules with a define_sql_migrations
macro that reads up/down SQL files via include_str!. Consolidate all
legacy single-file SQL into per-table directories and add full schema
migration coverage for 90+ tables.
2026-05-18 20:42:47 +08:00

23 lines
927 B
SQL

create table if not exists room_attachment
(
id uuid not null
primary key,
room uuid not null,
message uuid not null,
uploader uuid not null,
file_name varchar(255) not null,
file_size bigint not null,
content_type varchar(100) not null,
s3_key varchar(500) not null,
created_at timestamp with time zone default now() not null
);
create index if not exists idx_room_attachment_room
on room_attachment (room);
create index if not exists idx_room_attachment_message
on room_attachment (message);
create index if not exists idx_room_attachment_uploader
on room_attachment (uploader);