···11-select l.at_uri, lb.at_uri as block, lm.did is not null as muted
11+select
22+ l.at_uri,
33+ lb.at_uri as block,
44+ lm.did is not null as muted
25from lists l
33- left join list_blocks lb on l.at_uri = lb.list_uri and lb.did = $1
44- left join list_mutes lm on l.at_uri = lm.list_uri and lm.did = $1
55-where l.at_uri = any ($2) and (lm.did is not null or lb.at_uri is not null)66+left join list_blocks lb on l.at_uri = lb.list_uri and lb.did = $1
77+left join list_mutes lm on l.at_uri = lm.list_uri and lm.did = $1
88+where l.at_uri = any($2) and (lm.did is not null or lb.at_uri is not null)
+29-17
crates/parakeet/src/sql/post_state.sql
···11select bq.*, coalesce(bq.at_uri = pinned_uri, false) as pinned
22-from (select p.at_uri,
33- p.did,
44- p.cid,
55- l.rkey as like_rkey,
66- r.rkey as repost_rkey,
77- b.did is not null as bookmarked,
88- tm.did is not null as thread_muted,
99- coalesce(pg.rules && ARRAY ['app.bsky.feed.postgate#disableRule'], false) as embed_disabled
1010- from posts p
1111- left join likes l on l.subject = p.at_uri and l.did = $1
1212- left join reposts r on r.post = p.at_uri and r.did = $1
1313- left join bookmarks b on b.subject = p.at_uri and b.did = $1
1414- left join postgates pg on pg.post_uri = p.at_uri
1515- left join thread_mutes tm on tm.thread = coalesce(p.root_uri, p.at_uri)
1616- where p.at_uri = any ($2)
1717- and (l.rkey is not null or r.rkey is not null or b.did is not null or tm.did is not null or pg.rules is not null)) bq,
1818- (select pinned_uri, pinned_cid from profiles where did = $1) pp;
22+from (
33+ select
44+ p.at_uri,
55+ p.did,
66+ p.cid,
77+ l.rkey as like_rkey,
88+ r.rkey as repost_rkey,
99+ b.did is not null as bookmarked,
1010+ tm.did is not null as thread_muted,
1111+ coalesce(
1212+ pg.rules && array['app.bsky.feed.postgate#disableRule'], false
1313+ ) as embed_disabled
1414+ from posts p
1515+ left join likes l on l.subject = p.at_uri and l.did = $1
1616+ left join reposts r on r.post = p.at_uri and r.did = $1
1717+ left join bookmarks b on b.subject = p.at_uri and b.did = $1
1818+ left join postgates pg on pg.post_uri = p.at_uri
1919+ left join thread_mutes tm on tm.thread = coalesce(p.root_uri, p.at_uri)
2020+ where
2121+ p.at_uri = any($2)
2222+ and (
2323+ l.rkey is not null
2424+ or r.rkey is not null
2525+ or b.did is not null
2626+ or tm.did is not null
2727+ or pg.rules is not null
2828+ )
2929+) bq,
3030+ (select pinned_uri, pinned_cid from profiles where did = $1) pp;
+24-19
crates/parakeet/src/sql/profile_state.sql
···11-with vlb as (select * from v_list_block_exp where did = $1 and subject = any ($2)),
22- vlm as (select * from v_list_mutes_exp where did = $1 and subject = any ($2)),
33- ps as (select * from profile_states where did = $1 and subject = any ($2)),
44- vlb2 as (select subject as did, did as subject, list_uri is not null as blocked
55- from v_list_block_exp
66- where did = any ($2)
77- and subject = $1)
88-select distinct on (did, subject) did,
99- subject,
1010- muting,
1111- ps.blocked or vlb2.blocked as blocked,
1212- blocking,
1313- following,
1414- followed,
1515- vlb.list_uri as list_block,
1616- vlm.list_uri as list_mute
11+with vlb as (select * from v_list_block_exp where did = $1 and subject = any($2)),
22+vlm as (select * from v_list_mutes_exp where did = $1 and subject = any($2)),
33+ps as (select * from profile_states where did = $1 and subject = any($2)),
44+vlb2 as (
55+ select subject as did, did as subject, list_uri is not null as blocked
66+ from v_list_block_exp
77+ where
88+ did = any($2)
99+ and subject = $1
1010+)
1111+1212+select distinct on (did, subject)
1313+ did,
1414+ subject,
1515+ muting,
1616+ ps.blocked or vlb2.blocked as blocked,
1717+ blocking,
1818+ following,
1919+ followed,
2020+ vlb.list_uri as list_block,
2121+ vlm.list_uri as list_mute
1722from ps
1818- full join vlb using (did, subject)
1919- full join vlm using (did, subject)
2020- full join vlb2 using (did, subject);2323+full join vlb using (did, subject)
2424+full join vlm using (did, subject)
2525+full join vlb2 using (did, subject);
+10-8
crates/parakeet/src/sql/thread.sql
···11-with recursive thread as (select at_uri, parent_uri, root_uri, 1 as depth
22- from posts
33- where parent_uri = $1 and violates_threadgate=FALSE
44- union all
55- select p.at_uri, p.parent_uri, p.root_uri, thread.depth + 1
66- from posts p
77- join thread on p.parent_uri = thread.at_uri
88- where thread.depth <= $2 and p.violates_threadgate=FALSE)
11+with recursive thread as (
22+ select at_uri, parent_uri, root_uri, 1 as depth
33+ from posts
44+ where parent_uri = $1 and violates_threadgate = FALSE
55+ union all
66+ select p.at_uri, p.parent_uri, p.root_uri, thread.depth + 1
77+ from posts p
88+ join thread on p.parent_uri = thread.at_uri
99+ where thread.depth <= $2 and p.violates_threadgate = FALSE
1010+)
911select *
1012from thread
1113order by depth desc;
+17-11
crates/parakeet/src/sql/thread_branching.sql
···11-with recursive thread as (select at_uri, parent_uri, root_uri, 1 as depth
22- from posts
33- where parent_uri = $1
44- and violates_threadgate = FALSE
55- union all
66- (select p.at_uri, p.parent_uri, p.root_uri, thread.depth + 1
77- from posts p
88- join thread on p.parent_uri = thread.at_uri
99- where thread.depth <= $2
1010- and violates_threadgate = FALSE
1111- LIMIT $3))
11+with recursive thread as (
22+ select at_uri, parent_uri, root_uri, 1 as depth
33+ from posts
44+ where
55+ parent_uri = $1
66+ and violates_threadgate = FALSE
77+ union all
88+ (
99+ select p.at_uri, p.parent_uri, p.root_uri, thread.depth + 1
1010+ from posts p
1111+ join thread on p.parent_uri = thread.at_uri
1212+ where
1313+ thread.depth <= $2
1414+ and violates_threadgate = FALSE
1515+ limit $3
1616+ )
1717+)
1218select *
1319from thread;
+15-11
crates/parakeet/src/sql/thread_parent.sql
···11-with recursive parents as (select at_uri, cid, parent_uri, root_uri, 0 as depth
22- from posts
33- where
44- at_uri = (select parent_uri from posts where at_uri = $1 and violates_threadgate = FALSE)
55- union all
66- select p.at_uri, p.cid, p.parent_uri, p.root_uri, parents.depth + 1
77- from posts p
88- join parents on p.at_uri = parents.parent_uri
99- where parents.depth <= $2
1010- and p.violates_threadgate = FALSE)
11+with recursive parents as (
22+ select at_uri, cid, parent_uri, root_uri, 0 as depth
33+ from posts
44+ where
55+ at_uri
66+ = (select parent_uri from posts where at_uri = $1 and violates_threadgate = FALSE)
77+ union all
88+ select p.at_uri, p.cid, p.parent_uri, p.root_uri, parents.depth + 1
99+ from posts p
1010+ join parents on p.at_uri = parents.parent_uri
1111+ where
1212+ parents.depth <= $2
1313+ and p.violates_threadgate = FALSE
1414+)
1115select *
1216from parents
1313-order by depth desc;1717+order by depth desc;
···1616--
1717-- SELECT diesel_manage_updated_at('users');
1818-- ```
1919-CREATE OR REPLACE FUNCTION diesel_manage_updated_at(_tbl regclass) RETURNS VOID AS $$
1919+CREATE OR REPLACE FUNCTION diesel_manage_updated_at(
2020+ _tbl regclass
2121+) RETURNS void AS $$
2022BEGIN
2123 EXECUTE format('CREATE TRIGGER set_updated_at BEFORE UPDATE ON %s
2224 FOR EACH ROW EXECUTE PROCEDURE diesel_set_updated_at()', _tbl);
···88 primary key (did, rkey)
99);
10101111-create index blocks_did_index on blocks (did);
1212-create index blocks_subject_index on blocks (subject);
1111+create index blocks_subject_index on blocks using hash (subject);
13121413create table follows
1514(
···2120 primary key (did, rkey)
2221);
23222424-create index follow_did_index on follows (did);
2525-create index follow_subject_index on follows (subject);2323+create index follow_subject_index on follows using hash (subject);
···11create table lists
22(
33- at_uri text primary key,
33+ at_uri text primary key,
44 owner text not null references actors (did),
55 cid text not null,
66···16161717create table list_items
1818(
1919- at_uri text primary key,
1919+ at_uri text primary key,
20202121 list_uri text not null,
2222 subject text not null,
···2525 indexed_at timestamp not null default now()
2626);
27272828-create index listitems_list_index on list_items (list_uri);
2929-create index listitems_subject_index on list_items (subject);
2828+create index listitems_list_index on list_items using hash (list_uri);
2929+create index listitems_subject_index on list_items using hash (subject);
30303131create table list_blocks
3232(
3333- at_uri text primary key,
3333+ at_uri text primary key,
34343535 did text not null references actors (did),
3636 list_uri text not null,
···4040);
41414242create index listblocks_list_index on list_blocks using hash (list_uri);
4343-create index listblocks_did_index on list_blocks using hash (did);4343+create index listblocks_did_index on list_blocks using hash (did);
···11create table feedgens
22(
33- at_uri text primary key,
33+ at_uri text primary key,
44 cid text not null,
55 owner text not null references actors (did),
66···1717 indexed_at timestamp not null default now()
1818);
19192020-create index feedgens_owner_index on feedgens using hash (owner);2020+create index feedgens_owner_index on feedgens using hash (owner);
···16161717create table backfill_jobs
1818(
1919- id serial primary key,
1919+ id serial primary key,
2020 did text not null,
2121 since text, -- for future use.
22222323- status text not null, -- pending/processing/failed/completed (completed rows will be deleted)
2323+ -- pending/processing/failed/completed (completed rows will be deleted)
2424+ status text not null,
2425 created_at timestamp not null default now(),
2526 updated_at timestamp not null default now()
2627);
27282829create unique index bfjobs_did_uindex on backfill_jobs (did);
2929-create index bfjobs_status on backfill_jobs (status);3030+create index bfjobs_status on backfill_jobs (status);
···11create table posts
22(
33- at_uri text primary key,
33+ at_uri text primary key,
44 cid text not null,
55 did text not null references actors (did),
66 record jsonb not null,
7788 content text not null,
99 facets jsonb,
1010- languages text[] not null,
1111- tags text[] not null,
1010+ languages text [] not null,
1111+ tags text [] not null,
12121313 parent_uri text,
1414 parent_cid text,
···1616 root_cid text,
17171818 embed text,
1919- embed_subtype text, -- this is used for recordWithMedia to store the type of media.
1919+ -- this is used for recordWithMedia to store the type of media.
2020+ embed_subtype text,
20212122 created_at timestamptz not null default now(),
2223 indexed_at timestamp not null default now()
2324);
24252525-create index posts_did_index on posts (did);
2626-create index posts_parent_index on posts (parent_uri);
2727-create index posts_root_index on posts (root_uri);
2626+create index posts_did_index on posts using hash (did);
2727+create index posts_parent_index on posts using hash (parent_uri);
2828+create index posts_root_index on posts using hash (root_uri);
2829create index posts_lang_index on posts using gin (languages);
2930create index posts_tags_index on posts using gin (tags);
3031···42434344 primary key (post_uri, seq)
4445);
4545-4646-create index post_embed_images_posturi on post_embed_images (post_uri);
47464847create table post_embed_video
4948(
···5756 height integer
5857);
59586060-create index post_embed_video_posturi on post_embed_video (post_uri);
6161-6259create table post_embed_video_captions
6360(
6461 post_uri text not null references posts (at_uri) on delete cascade deferrable,
···7067 primary key (post_uri, language)
7168);
72697373-create index post_embed_video_captions_posturi on post_embed_video_captions (post_uri);
7474-7570create table post_embed_ext
7671(
7772 post_uri text primary key references posts (at_uri) on delete cascade deferrable,
···8277 thumb_mime_type text,
8378 thumb_cid text
8479);
8585-8686-create index post_embed_ext_posturi on post_embed_ext (post_uri);
87808881create table post_embed_record
8982(
···9588 detached bool not null default false
9689);
97909898-create index post_embed_record_posturi on post_embed_record (post_uri);
9991create index post_embed_record_detached on post_embed_record (detached);
100100-create index post_embed_record_uri on post_embed_record (uri);
9292+create index post_embed_record_uri on post_embed_record using hash (uri);
1019310294create table postgates
10395(
104104- at_uri text primary key,
9696+ at_uri text primary key,
10597 cid text not null,
10698 post_uri text not null,
10799108108- detached text[] not null,
109109- rules text[] not null,
100100+ detached text [] not null,
101101+ rules text [] not null,
110102111103 created_at timestamptz not null default now(),
112104 indexed_at timestamp not null default now()
113105);
114106115115-create index postgates_posts on postgates (post_uri);
107107+create index postgates_posts on postgates using hash (post_uri);
116108create index postgates_detached on postgates using gin (detached);
117109create index postgates_rules on postgates using gin (rules);
118110119111create table threadgates
120112(
121121- at_uri text primary key,
113113+ at_uri text primary key,
122114 cid text not null,
123115 post_uri text not null,
124116125125- hidden_replies text[] not null,
126126- allow text[],
127127- allowed_lists text[],
117117+ hidden_replies text [] not null,
118118+ allow text [],
119119+ allowed_lists text [],
128120129121 record jsonb not null,
130122···132124 indexed_at timestamp not null default now()
133125);
134126135135-create index threadgates_posts on threadgates (post_uri);
127127+create index threadgates_posts on threadgates using hash (post_uri);
136128create index threadgates_hidden on threadgates using gin (hidden_replies);
137129create index threadgates_allow on threadgates using gin (allow);
138130create index threadgates_allowedlist on threadgates using gin (allowed_lists);
139131140140-create or replace function maintain_postgates(post text, detached_posts text[], effective timestamp) returns void as
132132+create or replace function maintain_postgates(
133133+ post text,
134134+ detached_posts text [],
135135+ effective timestamp
136136+) returns void as
141137$$
142138begin
143139 -- first clear all the old data
···158154 end if;
159155160156end;
161161-$$ language plpgsql;157157+$$ language plpgsql;
···1010 primary key (did, rkey)
1111);
12121313-create index likes_did_index on likes (did);
1414-create index likes_subject_index on likes (subject);
1313+create index likes_subject_index on likes using hash (subject);
15141615create table reposts
1716(
···2524 primary key (did, rkey)
2625);
27262828-create index reposts_did_index on reposts (did);
2929-create index reposts_post_index on reposts (post);2727+create index reposts_post_index on reposts using hash (post);
···11create table chat_decls
22(
33- did text primary key references actors (did),
33+ did text primary key references actors (did),
44 allow_incoming text not null,
55 indexed_at timestamp not null default now()
66-);66+);
···11create table starterpacks
22(
33- at_uri text primary key,
33+ at_uri text primary key,
44 owner text not null references actors (did),
55 cid text not null,
66 record jsonb not null,
···99 description text,
1010 description_facets jsonb,
1111 list text not null,
1212- feeds text[],
1212+ feeds text [],
13131414 created_at timestamptz not null default now(),
1515 indexed_at timestamp not null default now()
···11create table labelers
22(
33- did text primary key references actors (did) on delete cascade,
33+ did text primary key references actors (did) on delete cascade,
44 cid text not null,
5566- reasons text[],
77- subject_types text[],
88- subject_collections text[],
66+ reasons text [],
77+ subject_types text [],
88+ subject_collections text [],
991010 created_at timestamp not null default now(),
1111 indexed_at timestamp not null default now()
···13131414create table labeler_defs
1515(
1616- id serial primary key,
1616+ id serial primary key,
17171818 labeler text not null references labelers (did) on delete cascade,
1919 label_identifier text not null,
···11create table verification
22(
33- at_uri text primary key,
33+ at_uri text primary key,
44 cid text not null,
55 verifier text not null references actors (did),
66···1212 indexed_at timestamp not null default now()
1313);
14141515-create index verification_verifier_index on verification (verifier);
1616-create index verification_subject_index on verification (subject);1515+create index verification_verifier_index on verification using hash (verifier);
1616+create index verification_subject_index on verification using hash (subject);
···11create table statuses
22(
33- did text primary key references actors (did),
33+ did text primary key references actors (did),
44 status text not null,
55 duration int,
66 record jsonb not null,
···13131414 created_at timestamptz not null default now(),
1515 indexed_at timestamp not null default now()
1616-);1616+);
···11alter table likes drop column via_uri, drop column via_cid;
22-alter table reposts drop column via_uri, drop column via_cid;22+alter table reposts drop column via_uri, drop column via_cid;
···1919 primary key (did, subject)
2020);
21212222-create index mutes_subject_index on mutes (subject);
2222+create index mutes_subject_index on mutes using hash (subject);
···55 subject text not null,
66 subject_cid text,
77 subject_type text not null,
88- tags text[] not null default ARRAY []::text[],
88+ tags text [] not null default array[]::text [],
991010 created_at timestamptz not null default now(),
1111···1313);
14141515create index bookmarks_rkey_index on bookmarks (rkey);
1616-create index bookmarks_subject_index on bookmarks (subject);
1616+create index bookmarks_subject_index on bookmarks using hash (subject);
1717create index bookmarks_subject_type_index on bookmarks (subject_type);
1818create index bookmarks_tags_index on bookmarks using gin (tags);
1919create unique index bookmarks_rkey_ui on bookmarks (did, rkey);
···16161717create view v_list_block_exp as
1818(
1919-select lb.list_uri, did, li.subject
2020-from list_blocks lb
2121- inner join list_items li on lb.list_uri = li.list_uri
2222- );
1919+ select lb.list_uri, did, li.subject
2020+ from list_blocks lb
2121+ inner join list_items li on lb.list_uri = li.list_uri
2222+);
23232424create view v_list_mutes_exp as
2525(
2626-select lm.list_uri, did, li.subject
2727-from list_mutes lm
2828- inner join list_items li on lm.list_uri = li.list_uri
2929- );
2626+ select lm.list_uri, did, li.subject
2727+ from list_mutes lm
2828+ inner join list_items li on lm.list_uri = li.list_uri
2929+);
30303131-- profile_states follow triggers
3232create function f_profile_state_ins_follow() returns trigger
3333- language plpgsql as
3333+language plpgsql as
3434$$
3535begin
3636 insert into profile_states (did, subject, following)
···4646$$;
47474848create trigger t_profile_state_ins
4949- before insert
5050- on follows
5151- for each row
4949+before insert
5050+on follows
5151+for each row
5252execute procedure f_profile_state_ins_follow();
53535454create function f_profile_state_del_follow() returns trigger
5555- language plpgsql as
5555+language plpgsql as
5656$$
5757begin
5858 update profile_states set following = null where did = OLD.did and subject = OLD.subject;
···6363$$;
64646565create trigger t_profile_state_del
6666- before delete
6767- on follows
6868- for each row
6666+before delete
6767+on follows
6868+for each row
6969execute procedure f_profile_state_del_follow();
70707171-- profile_states block triggers
72727373create function f_profile_state_ins_block() returns trigger
7474- language plpgsql as
7474+language plpgsql as
7575$$
7676begin
7777 insert into profile_states (did, subject, blocking)
···8787$$;
88888989create trigger t_profile_state_ins
9090- before insert
9191- on blocks
9292- for each row
9090+before insert
9191+on blocks
9292+for each row
9393execute procedure f_profile_state_ins_block();
94949595create function f_profile_state_del_block() returns trigger
9696- language plpgsql as
9696+language plpgsql as
9797$$
9898begin
9999 update profile_states set blocking = null where did = OLD.did and subject = OLD.subject;
···104104$$;
105105106106create trigger t_profile_state_del
107107- before delete
108108- on blocks
109109- for each row
107107+before delete
108108+on blocks
109109+for each row
110110execute procedure f_profile_state_del_block();
111111112112-- profile_states mutes triggers
113113114114create function f_profile_state_ins_mute() returns trigger
115115- language plpgsql as
115115+language plpgsql as
116116$$
117117begin
118118 insert into profile_states (did, subject, muting)
···124124$$;
125125126126create trigger t_profile_state_ins
127127- before insert
128128- on mutes
129129- for each row
127127+before insert
128128+on mutes
129129+for each row
130130execute procedure f_profile_state_ins_mute();
131131132132create function f_profile_state_del_mute() returns trigger
133133- language plpgsql as
133133+language plpgsql as
134134$$
135135begin
136136 update profile_states set muting = false where did = OLD.did and subject = OLD.subject;
···140140$$;
141141142142create trigger t_profile_state_del
143143- before delete
144144- on mutes
145145- for each row
146146-execute procedure f_profile_state_del_mute();143143+before delete
144144+on mutes
145145+for each row
146146+execute procedure f_profile_state_del_mute();
···11alter table posts
22- drop column mentions,
33- drop column violates_threadgate;
22+drop column mentions,
33+drop column violates_threadgate;
4455drop trigger t_author_feed_ins_post on posts;
66drop trigger t_author_feed_del_post on posts;
···1212drop function f_author_feed_ins_repost;
1313drop function f_author_feed_del_repost;
14141515-drop table author_feeds;1515+drop table author_feeds;
+19-19
migrations/2025-09-27-171241_post-tweaks/up.sql
···11alter table posts
22- add column mentions text[],
33- add column violates_threadgate bool not null default false;
22+add column mentions text [],
33+add column violates_threadgate bool not null default false;
4455create table author_feeds
66(
77- uri text primary key,
77+ uri text primary key,
88 cid text not null,
99 post text not null,
1010 did text not null,
···14141515-- author_feeds post triggers
1616create function f_author_feed_ins_post() returns trigger
1717- language plpgsql as
1717+language plpgsql as
1818$$
1919begin
2020 insert into author_feeds (uri, cid, post, did, typ, sort_at)
···2525$$;
26262727create trigger t_author_feed_ins_post
2828- before insert
2929- on posts
3030- for each row
2828+before insert
2929+on posts
3030+for each row
3131execute procedure f_author_feed_ins_post();
32323333create function f_author_feed_del_post() returns trigger
3434- language plpgsql as
3434+language plpgsql as
3535$$
3636begin
3737 delete from author_feeds where did = OLD.did and uri = OLD.at_uri and typ = 'post';
···4040$$;
41414242create trigger t_author_feed_del_post
4343- before delete
4444- on posts
4545- for each row
4343+before delete
4444+on posts
4545+for each row
4646execute procedure f_author_feed_del_post();
47474848-- author_feeds repost triggers
4949create function f_author_feed_ins_repost() returns trigger
5050- language plpgsql as
5050+language plpgsql as
5151$$
5252begin
5353 insert into author_feeds (uri, cid, post, did, typ, sort_at)
···5858$$;
59596060create trigger t_author_feed_ins_repost
6161- before insert
6262- on reposts
6363- for each row
6161+before insert
6262+on reposts
6363+for each row
6464execute procedure f_author_feed_ins_repost();
65656666create function f_author_feed_del_repost() returns trigger
6767- language plpgsql as
6767+language plpgsql as
6868$$
6969begin
7070 delete from author_feeds where did = OLD.did and post = OLD.post and typ = 'repost';
···7373$$;
74747575create trigger t_author_feed_del_repost
7676- before delete
7777- on reposts
7878- for each row
7676+before delete
7777+on reposts
7878+for each row
7979execute procedure f_author_feed_del_repost();
+13-13
migrations/2026-03-18-175443-0000_drafts/up.sql
···11create table drafts (
22-did text not null references actors (did),
33-draft_id text not null, -- draft_id is an rkey
22+ did text not null references actors (did),
33+ draft_id text not null, -- draft_id is an rkey
4455-device_id text,
66-device_name text,
55+ device_id text,
66+ device_name text,
7788-posts jsonb not null,
99-languages text [],
1010-postgate_embedding_rules text [],
1111-threadgate_allow text [],
1212-threadgate_allowed_lists text [],
88+ posts jsonb not null,
99+ languages text [],
1010+ postgate_embedding_rules text [],
1111+ threadgate_allow text [],
1212+ threadgate_allowed_lists text [],
13131414-created_at timestamptz not null default now (),
1515-updated_at timestamptz not null default now (),
1414+ created_at timestamptz not null default now(),
1515+ updated_at timestamptz not null default now(),
16161717-primary key (did, draft_id)
1818-) ;
1717+ primary key (did, draft_id)
1818+);
···11create table thread_mutes
22(
33- did text not null references actors (did),
44- thread text not null,
33+ did text not null references actors (did),
44+ thread text not null,
55 created_at timestamptz not null default now(),
6677 primary key (did, thread)
88);
991010-create index threadmutes_list_index on thread_mutes (thread);
1010+create index threadmutes_thread_index on thread_mutes using hash (thread);