Initial commit — eLegal Software monorepo
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import { pgTable, uuid, text, timestamp, index } from 'drizzle-orm/pg-core';
|
||||
import { firms } from './firms';
|
||||
|
||||
export const clients = pgTable(
|
||||
'clients',
|
||||
{
|
||||
id: uuid('id').defaultRandom().primaryKey(),
|
||||
firmId: uuid('firm_id')
|
||||
.notNull()
|
||||
.references(() => firms.id, { onDelete: 'cascade' }),
|
||||
name: text('name').notNull(),
|
||||
email: text('email'),
|
||||
phone: text('phone'),
|
||||
address: text('address'),
|
||||
notes: text('notes'),
|
||||
createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(),
|
||||
updatedAt: timestamp('updated_at', { withTimezone: true }).notNull().defaultNow(),
|
||||
},
|
||||
(t) => ({
|
||||
firmIdx: index('clients_firm_idx').on(t.firmId),
|
||||
}),
|
||||
);
|
||||
Reference in New Issue
Block a user