From 65675f14664f4870e13f4a71d5981ef6aade8326 Mon Sep 17 00:00:00 2001 From: netkas Date: Thu, 5 Jun 2025 00:37:55 -0400 Subject: [PATCH] Add evidence and lifted columns to blacklist table with appropriate constraints and indexing --- .../Classes/Resources/blacklist.sql | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/FederationServer/Classes/Resources/blacklist.sql b/src/FederationServer/Classes/Resources/blacklist.sql index 53d28c6..c3e852a 100644 --- a/src/FederationServer/Classes/Resources/blacklist.sql +++ b/src/FederationServer/Classes/Resources/blacklist.sql @@ -1,10 +1,12 @@ create table blacklist ( - uuid varchar(36) default uuid() not null comment 'The Unique Universal Identifier of the blacklist record' - primary key comment 'The Unique Universal Identifier Primary Unique Index', + uuid varchar(36) default uuid() not null comment 'The Unique Universal Identifier Primary Unique Index' + primary key, operator varchar(36) not null comment 'The operator that created this blacklist record', entity varchar(36) not null comment 'The target entity that is blacklisted', + evidence varchar(36) null comment 'Optional. The evidence for the blacklist', type enum ('SPAM', 'SCAM', 'SERVICE_ABUSE', 'ILLEGAL_CONTENT', 'MALWARE', 'PHISHING', 'CSAM', 'OTHER') not null comment 'The blacklist reason type', + lifted tinyint(1) default 0 not null comment 'Default: 0, 1=The blacklist was lifted and is no longer in effect, 0=The blacklist is not lifted, it is in effect until it expires', expires timestamp null comment 'The timestamp for when the blacklist expires, if null the blacklist never expires', created timestamp default current_timestamp() not null comment 'The Timestamp for when the record was created', constraint blacklist_uuid_uindex @@ -12,6 +14,9 @@ create table blacklist constraint blacklist_entities_uuid_fk foreign key (entity) references entities (uuid) on update cascade on delete cascade, + constraint blacklist_evidence_uuid_fk + foreign key (evidence) references evidence (uuid) + on update cascade on delete cascade, constraint blacklist_operators_uuid_fk foreign key (operator) references operators (uuid) on update cascade on delete cascade @@ -26,6 +31,10 @@ create index blacklist_entity_index on blacklist (entity) comment 'The Unique Universal Identifier of the entity index'; +create index blacklist_evidence_index + on blacklist (evidence) + comment 'The index for the blacklist evidence column'; + create index blacklist_operator_index on blacklist (operator) comment 'The Unique Universal Identifier of the operator index';