16 lines
565 B
TypeScript
16 lines
565 B
TypeScript
// db/schema.ts
|
|
import { pgTable, varchar, timestamp, primaryKey } from 'drizzle-orm/pg-core'
|
|
import merchants from './merchants'
|
|
|
|
export const merchantNonces = pgTable('merchant_nonces', {
|
|
merchantId: varchar('merchant_id', { length: 64 })
|
|
.notNull()
|
|
.references(() => merchants.merchantId, { onDelete: 'cascade' }),
|
|
nonce: varchar('nonce', { length: 128 }).notNull(),
|
|
createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(),
|
|
}, (t) => [
|
|
primaryKey({ columns: [t.merchantId, t.nonce] }),
|
|
])
|
|
|
|
export default merchantNonces
|