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 education = pgTable(
5 'education',
6 {
7 did: text('did')
8 .notNull()
9 .references(() => profiles.did, { onDelete: 'cascade' }),
10 rkey: text('rkey').notNull(),
11 institution: text('institution').notNull(),
12 institutionDid: text('institution_did'),
13 degree: text('degree'),
14 fieldOfStudy: text('field_of_study'),
15 description: text('description'),
16 startedAt: text('started_at'),
17 endedAt: text('ended_at'),
18 createdAt: timestamp('created_at', { withTimezone: true }).notNull(),
19 indexedAt: timestamp('indexed_at', { withTimezone: true }).notNull().defaultNow(),
20 },
21 (table) => [primaryKey({ columns: [table.did, table.rkey] })],
22);