From c20cd2e10b2ba150170b3b2da646fd207457e73a Mon Sep 17 00:00:00 2001 From: netkas Date: Fri, 30 May 2025 12:02:57 -0400 Subject: [PATCH] Add file_attachments table for storing file attachments related to evidence records --- .../Classes/Resources/file_attachments.sql | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/FederationServer/Classes/Resources/file_attachments.sql diff --git a/src/FederationServer/Classes/Resources/file_attachments.sql b/src/FederationServer/Classes/Resources/file_attachments.sql new file mode 100644 index 0000000..80034a6 --- /dev/null +++ b/src/FederationServer/Classes/Resources/file_attachments.sql @@ -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'; +