20 lines
583 B
TypeScript
20 lines
583 B
TypeScript
![]() |
import { text, integer, sqliteTable } from 'drizzle-orm/sqlite-core';
|
||
|
|
||
|
export const messages = sqliteTable('messages', {
|
||
|
id: integer('id').primaryKey(),
|
||
|
content: text('content').notNull(),
|
||
|
chatId: text('chatId').notNull(),
|
||
|
messageId: text('messageId').notNull(),
|
||
|
role: text('type', { enum: ['assistant', 'user'] }),
|
||
|
metadata: text('metadata', {
|
||
|
mode: 'json',
|
||
|
}),
|
||
|
});
|
||
|
|
||
|
export const chats = sqliteTable('chats', {
|
||
|
id: text('id').primaryKey(),
|
||
|
title: text('title').notNull(),
|
||
|
createdAt: text('createdAt').notNull(),
|
||
|
focusMode: text('focusMode').notNull(),
|
||
|
});
|