tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
27
pulls
pipelines
add handle to bsky_profiles table
awarm.space
9 months ago
75c4e119
3d5a5785
+12
4 changed files
expand all
collapse all
unified
split
appview
index.ts
drizzle
schema.ts
supabase
database.types.ts
migrations
20250615154505_add_handle_to_bsky_profiles.sql
+7
appview/index.ts
···
50
50
ids.AppBskyActorProfile,
51
51
],
52
52
handleEvent: async (evt) => {
53
53
+
if (evt.event === "identity") {
54
54
+
if (evt.handle)
55
55
+
await supabase
56
56
+
.from("bsky_profiles")
57
57
+
.update({ handle: evt.handle })
58
58
+
.eq("did", evt.did);
59
59
+
}
53
60
if (
54
61
evt.event == "account" ||
55
62
evt.event === "identity" ||
+1
drizzle/schema.ts
···
28
28
did: text("did").primaryKey().notNull().references(() => identities.atp_did, { onDelete: "cascade" } ),
29
29
record: jsonb("record").notNull(),
30
30
indexed_at: timestamp("indexed_at", { withTimezone: true, mode: 'string' }).defaultNow().notNull(),
31
31
+
handle: text("handle"),
31
32
});
32
33
33
34
export const publications = pgTable("publications", {
+3
supabase/database.types.ts
···
37
37
bsky_profiles: {
38
38
Row: {
39
39
did: string
40
40
+
handle: string | null
40
41
indexed_at: string
41
42
record: Json
42
43
}
43
44
Insert: {
44
45
did: string
46
46
+
handle?: string | null
45
47
indexed_at?: string
46
48
record: Json
47
49
}
48
50
Update: {
49
51
did?: string
52
52
+
handle?: string | null
50
53
indexed_at?: string
51
54
record?: Json
52
55
}
+1
supabase/migrations/20250615154505_add_handle_to_bsky_profiles.sql
···
1
1
+
alter table "public"."bsky_profiles" add column "handle" text;