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.
23 lines
927 B
SQL
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);
|