22 lines
698 B
TypeScript
22 lines
698 B
TypeScript
import { pgTable, serial, text, integer, timestamp, boolean } from 'drizzle-orm/pg-core';
|
|
|
|
export const domains = pgTable('domains', {
|
|
id: serial('id').primaryKey(),
|
|
bucket: text('bucket').unique().notNull(),
|
|
domain: text('domain').notNull(),
|
|
});
|
|
|
|
export const emails = pgTable('emails', {
|
|
id: serial('id').primaryKey(),
|
|
domainId: integer('domain_id').references(() => domains.id).notNull(),
|
|
s3Key: text('s3_key').unique().notNull(),
|
|
from: text('from'),
|
|
to: text('to').array(),
|
|
cc: text('cc').array(),
|
|
bcc: text('bcc').array(),
|
|
subject: text('subject'),
|
|
html: text('html'),
|
|
raw: text('raw'),
|
|
processed: boolean('processed').default(false),
|
|
date: timestamp('date'),
|
|
}); |