Add file_attachments table for storing file attachments related to evidence records

This commit is contained in:
netkas 2025-05-30 12:02:57 -04:00
parent c68f1d206e
commit c20cd2e10b
Signed by: netkas
GPG key ID: 4D8629441B76E4CC

View file

@ -0,0 +1,20 @@
create table file_attachments
(
uuid varchar(36) default uuid() not null comment 'The Unique Universal Identifier of the file attachment'
primary key comment 'The Unique Universal Identifier Unique Index',
evidence varchar(36) not null comment 'The Unique Universal Identifier of the evidence that this file is attached to',
file_name varchar(255) not null comment 'The name of the file',
file_size bigint not null comment 'The size of the file',
created timestamp default current_timestamp() not null comment 'The Timestamp for when this file attachment was created',
constraint file_attachments_uuid_uindex
unique (uuid) comment 'The Unique Universal Identifier Unique Index',
constraint file_attachments_evidence_uuid_fk
foreign key (evidence) references evidence (uuid)
on update cascade on delete cascade
)
comment 'A table for housing file attachments related to evidence records';
create index file_attachments_evidence_index
on file_attachments (evidence)
comment 'The file attachment index';