Sifa professional network API (Fastify, AT Protocol, Jetstream)
sifa.id/
1import { pgTable, text, timestamp, primaryKey } from 'drizzle-orm/pg-core';
2import { profiles } from './profiles.js';
3
4export const projects = pgTable(
5 'projects',
6 {
7 did: text('did')
8 .notNull()
9 .references(() => profiles.did, { onDelete: 'cascade' }),
10 rkey: text('rkey').notNull(),
11 name: text('name').notNull(),
12 description: text('description'),
13 url: text('url'),
14 startedAt: text('started_at'),
15 endedAt: text('ended_at'),
16 createdAt: timestamp('created_at', { withTimezone: true }).notNull(),
17 indexedAt: timestamp('indexed_at', { withTimezone: true }).notNull().defaultNow(),
18 },
19 (table) => [primaryKey({ columns: [table.did, table.rkey] })],
20);