lemmy/migrations/2023-08-01-115243_persistent-activity-queue/up.sql

27 lines
807 B
MySQL
Raw Normal View History

2023-07-23 15:00:16 -06:00
CREATE TYPE actor_type_enum AS enum(
'site',
'community',
'person'
);
2023-07-24 08:02:15 -06:00
-- actor_apub_id only null for old entries
2023-07-23 15:00:16 -06:00
ALTER TABLE sent_activity
ADD COLUMN send_targets jsonb NOT NULL DEFAULT '{"inboxes": [], "community_followers_of": [], "all_instances": false}',
ADD COLUMN actor_type actor_type_enum NOT NULL DEFAULT 'person',
2023-07-24 08:02:15 -06:00
ADD COLUMN actor_apub_id text DEFAULT NULL;
2023-07-23 15:00:16 -06:00
ALTER TABLE sent_activity
ALTER COLUMN send_targets DROP DEFAULT,
2023-07-24 08:02:15 -06:00
ALTER COLUMN actor_type DROP DEFAULT;
2023-07-23 15:00:16 -06:00
CREATE TABLE federation_queue_state(
domain text PRIMARY KEY,
last_successful_id bigint NOT NULL,
fail_count integer NOT NULL,
last_retry timestamptz NOT NULL
);
-- for incremental fetches of followers
CREATE INDEX idx_community_follower_published ON community_follower(published);