diff --git a/fedilogue/tables.sql b/fedilogue/tables.sql index 2059b38..6ca61fd 100644 --- a/fedilogue/tables.sql +++ b/fedilogue/tables.sql @@ -13,6 +13,7 @@ CREATE TABLE activities ( id SERIAL PRIMARY KEY, document JSONB, normalized TEXT, + identifiedat TIMESTAMP with time zone DEFAULT now(), instance VARCHAR(1000) NOT NULL ); @@ -34,10 +35,14 @@ ALTER TABLE activities GENERATED ALWAYS AS (to_tsvector('english', normalized)) STORED; +CREATE UNIQUE INDEX actors_uri_idx ON actors ( (document->>'id') ); +CREATE UNIQUE INDEX activities_uri_idx ON activities ( (document->>'id') ); + +CREATE INDEX activities_published_idx ON activities ( (document->>'published') ); +CREATE INDEX activities_identifiedat_idx ON activities (identifiedat); CREATE INDEX normalized_idx ON activities USING gin(normalized_tsvector); CREATE INDEX actors_id_idx ON actors (id); CREATE INDEX activities_id_idx ON activities (id); -CREATE UNIQUE INDEX actors_uri_idx ON actors ( (document->>'id') ); -CREATE UNIQUE INDEX activities_uri_idx ON activities ( (document->>'id') ); +