Sifa professional network API (Fastify, AT Protocol, Jetstream) sifa.id/
at main 21 lines 772 B view raw
1import { pgTable, text, timestamp, primaryKey } from 'drizzle-orm/pg-core'; 2import { profiles } from './profiles.js'; 3 4export const certifications = pgTable( 5 'certifications', 6 { 7 did: text('did') 8 .notNull() 9 .references(() => profiles.did, { onDelete: 'cascade' }), 10 rkey: text('rkey').notNull(), 11 name: text('name').notNull(), 12 authority: text('authority'), 13 credentialId: text('credential_id'), 14 credentialUrl: text('credential_url'), 15 issuedAt: text('issued_at'), 16 expiresAt: text('expires_at'), 17 createdAt: timestamp('created_at', { withTimezone: true }).notNull(), 18 indexedAt: timestamp('indexed_at', { withTimezone: true }).notNull().defaultNow(), 19 }, 20 (table) => [primaryKey({ columns: [table.did, table.rkey] })], 21);