From 51b501e329a545347b95ec0fa0302d25c926a39a Mon Sep 17 00:00:00 2001 From: netkas Date: Fri, 30 May 2025 12:02:47 -0400 Subject: [PATCH] Add entities table for storing known entities and their attributes --- .../Classes/Resources/entities.sql | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/FederationServer/Classes/Resources/entities.sql diff --git a/src/FederationServer/Classes/Resources/entities.sql b/src/FederationServer/Classes/Resources/entities.sql new file mode 100644 index 0000000..5a50912 --- /dev/null +++ b/src/FederationServer/Classes/Resources/entities.sql @@ -0,0 +1,22 @@ +create table entities +( + uuid varchar(36) default uuid() not null comment 'The Unique Universal Identifier of the entity' + primary key comment 'The primary unique index of the entity', + id varchar(255) not null comment 'The Unique Identifier of the entity', + domain varchar(255) null comment 'The domain', + created timestamp default current_timestamp() not null comment 'The Timestamp for when this entity was created', + constraint entities_id_domain_uindex + unique (id, domain) comment 'The Unique Index of the Entity ID and Domain combination', + constraint entities_uuid_uindex + unique (uuid) comment 'The primary unique index of the entity' +) + comment 'A table for housing known entities in the database'; + +create index entities_domain_index + on entities (domain) + comment 'The domain name of the entity'; + +create index entities_id_index + on entities (id) + comment 'The index of the entity ID'; +