20 lines
533 B
TypeScript
20 lines
533 B
TypeScript
import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core';
|
|
|
|
export const user = sqliteTable('user', {
|
|
id: text('id').primaryKey(),
|
|
username: text('username').notNull(),
|
|
name: text('name').notNull(),
|
|
});
|
|
|
|
export const session = sqliteTable('session', {
|
|
id: text('id').primaryKey(),
|
|
userId: text('user_id')
|
|
.notNull()
|
|
.references(() => user.id),
|
|
expiresAt: integer('expires_at', { mode: 'timestamp' }).notNull()
|
|
});
|
|
|
|
export type Session = typeof session.$inferSelect;
|
|
|
|
export type User = typeof user.$inferSelect;
|