this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

user -> atproto_user

alice 24d56749 eeb027ae

+20 -3
+17
src/db/migrations.ts
··· 30 30 }, 31 31 } 32 32 33 + // you cannot actually create a table called "user" in postgres because it's a reserved word :( 33 34 migrations['002'] = { 34 35 async up(db: Kysely<unknown>) { 35 36 await db.schema ··· 71 72 await db.schema.dropTable('repost').execute() 72 73 }, 73 74 } 75 + 76 + migrations['005'] = { 77 + async up(db: Kysely<unknown>) { 78 + await db.schema 79 + .createTable('atproto_user') 80 + .addColumn('did', 'varchar', (col) => col.primaryKey()) 81 + .addColumn('handle', 'varchar', (col) => col.notNull()) 82 + .addColumn('displayName', 'varchar') 83 + .addColumn('bio', 'varchar') 84 + .addColumn('indexedAt', 'varchar', (col) => col.notNull()) 85 + .execute() 86 + }, 87 + async down(db: Kysely<unknown>) { 88 + await db.schema.dropTable('atproto_user').execute() 89 + }, 90 + }
+1 -1
src/db/schema.ts
··· 1 1 export type DatabaseSchema = { 2 2 post: Post 3 3 repost: Repost 4 - user: User 4 + atproto_user: User 5 5 alice: Alice 6 6 sub_state: SubState 7 7 }
+2 -2
src/subscription.ts
··· 88 88 89 89 ops.posts.creates.forEach(async (create) => { 90 90 const user = await this.db 91 - .selectFrom('user') 91 + .selectFrom('atproto_user') 92 92 .select('did') 93 93 .where('did', '=', create.author) 94 94 .execute() ··· 98 98 actor: create.author, 99 99 }) 100 100 await this.db 101 - .insertInto('user') 101 + .insertInto('atproto_user') 102 102 .values({ 103 103 did: create.author, 104 104 handle: profile.data.handle,