CREATE TABLE IF NOT EXISTS room_attachment ( id UUID 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 TIMESTAMPTZ NOT NULL DEFAULT NOW() ); CREATE INDEX idx_room_attachment_room ON room_attachment (room); CREATE INDEX idx_room_attachment_message ON room_attachment (message); CREATE INDEX idx_room_attachment_uploader ON room_attachment (uploader);