social bookmarking for atproto

[appview/indexer] Store CIDs of records

hexmani.ac ef5f8721 7cb52652

verified
+6
+3
backend/src/db/schema.ts
··· 16 16 .default(sql`(unixepoch() * 1000)`), 17 17 did: text("did").notNull(), 18 18 recordKey: text("rkey").notNull(), 19 + cid: text("cid").notNull(), 19 20 url: text("url").notNull(), 20 21 title: text("title").notNull(), 21 22 description: text("description").notNull(), ··· 43 44 .default(sql`(unixepoch() * 1000)`), 44 45 did: text("did").notNull(), 45 46 recordKey: text("rkey").notNull(), 47 + cid: text("cid").notNull(), 46 48 name: text("name").notNull(), 47 49 description: text("description"), 48 50 color: text("color"), ··· 60 62 .notNull() 61 63 .default(sql`(unixepoch() * 1000)`), 62 64 did: text("did").notNull().unique(), 65 + cid: text("cid").notNull(), 63 66 displayName: text("displayName"), 64 67 description: text("description"), 65 68 avatar: text("avatar"),
+3
backend/src/network/commit.ts
··· 83 83 await db.insert(clipsTable).values({ 84 84 // @ts-expect-error Weird type error despite being a normal string. 85 85 did: convertDidToString(event.did), 86 + cid: event.commit.cid, 86 87 timestamp: convertMicroToDate(event.time_us), 87 88 recordKey: event.commit.rkey, 88 89 createdAt: new Date(record.createdAt), ··· 150 151 await db.insert(tagsTable).values({ 151 152 timestamp: convertMicroToDate(event.time_us), 152 153 did: convertDidToString(event.did), 154 + cid: event.commit.cid, 153 155 recordKey: event.commit.rkey, 154 156 name: record.name, 155 157 description: record.description, ··· 245 247 246 248 await db.insert(usersTable).values({ 247 249 did: convertDidToString(event.did), 250 + cid: event.commit.cid, 248 251 timestamp: convertMicroToDate(event.time_us), 249 252 createdAt: new Date(record.createdAt), 250 253 displayName: record.displayName,