1 -- The Activitypub activity table
2 -- All user actions must create a row here.
3 create table activity (
5 user_id int references user_ on update cascade on delete cascade not null, -- Ensures that the user is set up here.
7 local boolean not null default true,
8 published timestamp not null default now(),
12 -- Making sure that id is unique
13 create unique index idx_activity_unique_apid on activity ((data ->> 'id'::text));
15 -- Add federation columns to the two actor tables
17 -- TODO uniqueness constraints should be added on these 3 columns later
18 add column actor_id character varying(255) not null default 'changeme', -- This needs to be checked and updated in code, building from the site url if local
19 add column bio text, -- not on community, already has description
20 add column local boolean not null default true,
21 add column private_key text, -- These need to be generated from code
22 add column public_key text,
23 add column last_refreshed_at timestamp not null default now() -- Used to re-fetch federated actor periodically
28 add column actor_id character varying(255) not null default 'changeme', -- This needs to be checked and updated in code, building from the site url if local
29 add column local boolean not null default true,
30 add column private_key text, -- These need to be generated from code
31 add column public_key text,
32 add column last_refreshed_at timestamp not null default now() -- Used to re-fetch federated actor periodically
35 -- Don't worry about rebuilding the views right now.