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);
