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 courses = pgTable(
5 'courses',
6 {
7 did: text('did')
8 .notNull()
9 .references(() => profiles.did, { onDelete: 'cascade' }),
10 rkey: text('rkey').notNull(),
11 name: text('name').notNull(),
12 number: text('number'),
13 institution: text('institution'),
14 createdAt: timestamp('created_at', { withTimezone: true }).notNull(),
15 indexedAt: timestamp('indexed_at', { withTimezone: true }).notNull().defaultNow(),
16 },
17 (table) => [primaryKey({ columns: [table.did, table.rkey] })],
18);