Remote follow fix

This commit is contained in:
Christopher
2026-01-22 15:42:15 -08:00
parent 2906063411
commit 898125a131
5 changed files with 257 additions and 11 deletions
+17
View File
@@ -188,6 +188,23 @@ export const followsRelations = relations(follows, ({ one }) => ({
}),
}));
// ============================================
// REMOTE FOLLOWS (for federated follows)
// ============================================
export const remoteFollows = pgTable('remote_follows', {
id: uuid('id').primaryKey().defaultRandom(),
followerId: uuid('follower_id').notNull().references(() => users.id, { onDelete: 'cascade' }),
targetHandle: text('target_handle').notNull(), // username@domain
targetActorUrl: text('target_actor_url').notNull(),
inboxUrl: text('inbox_url').notNull(),
activityId: text('activity_id').notNull(), // UUID token for activity URL
createdAt: timestamp('created_at').defaultNow().notNull(),
}, (table) => [
index('remote_follows_follower_idx').on(table.followerId),
index('remote_follows_target_idx').on(table.targetHandle),
]);
// ============================================
// LIKES
// ============================================