parent
d3b3449eb8
commit
f2320bf321
14 changed files with 879 additions and 145 deletions
|
|
@ -4,12 +4,14 @@ import {
|
|||
varchar,
|
||||
timestamp,
|
||||
json,
|
||||
jsonb,
|
||||
uuid,
|
||||
text,
|
||||
primaryKey,
|
||||
foreignKey,
|
||||
boolean,
|
||||
} from 'drizzle-orm/pg-core';
|
||||
import type { LanguageModelV2Usage } from '@ai-sdk/provider';
|
||||
|
||||
export const user = pgTable('User', {
|
||||
id: uuid('id').primaryKey().notNull().defaultRandom(),
|
||||
|
|
@ -29,6 +31,7 @@ export const chat = pgTable('Chat', {
|
|||
visibility: varchar('visibility', { enum: ['public', 'private'] })
|
||||
.notNull()
|
||||
.default('private'),
|
||||
lastContext: jsonb('lastContext').$type<LanguageModelV2Usage | null>(),
|
||||
});
|
||||
|
||||
export type Chat = InferSelectModel<typeof chat>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue