mirror of
https://github.com/pupperpowell/bibdle.git
synced 2026-04-05 17:33:31 -04:00
Version 1
This commit is contained in:
26
src/lib/server/db/schema.ts
Normal file
26
src/lib/server/db/schema.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { integer, sqliteTable, text } from 'drizzle-orm/sqlite-core';
|
||||
|
||||
import { sql } from 'drizzle-orm';
|
||||
|
||||
export const user = sqliteTable('user', { id: text('id').primaryKey(), age: integer('age') });
|
||||
|
||||
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;
|
||||
|
||||
export const dailyVerses = sqliteTable('daily_verses', {
|
||||
id: text('id').primaryKey(),
|
||||
date: text('date').unique().notNull(),
|
||||
bookId: text('book_id').notNull(),
|
||||
verseText: text('verse_text').notNull(),
|
||||
reference: text('reference').notNull(),
|
||||
createdAt: integer('created_at', { mode: 'timestamp' }),
|
||||
});
|
||||
|
||||
export type DailyVerse = typeof dailyVerses.$inferSelect;
|
||||
Reference in New Issue
Block a user