Fix Edge-incompatible middleware; set Node runtime on Prisma/pg routes; add full Romanian Bible import + converter; import data JSON; resync RO bookKeys; stabilize /api/bible/books locale fallback; restart dev server.

This commit is contained in:
andupetcu
2025-09-20 18:01:04 +03:00
parent 500066450d
commit 88b251c100
28 changed files with 127926 additions and 175 deletions

View File

@@ -40,19 +40,43 @@ model Session {
@@index([token])
}
model BibleVersion {
id String @id @default(uuid())
name String // e.g., "King James Version", "Cornilescu"
abbreviation String // e.g., "KJV", "CORNILESCU", "NIV"
language String // e.g., "en", "ro", "es"
description String?
isDefault Boolean @default(false)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
books BibleBook[]
@@unique([abbreviation, language])
@@index([language])
@@index([isDefault])
}
model BibleBook {
id Int @id
name String
id String @id @default(uuid())
versionId String
name String // Version-specific book name
testament String
orderNum Int
bookKey String // For cross-version matching (e.g., "genesis", "exodus")
chapters BibleChapter[]
version BibleVersion @relation(fields: [versionId], references: [id])
@@unique([versionId, orderNum])
@@unique([versionId, bookKey])
@@index([versionId])
@@index([testament])
}
model BibleChapter {
id String @id @default(uuid())
bookId Int
bookId String
chapterNum Int
verses BibleVerse[]
@@ -67,15 +91,13 @@ model BibleVerse {
chapterId String
verseNum Int
text String @db.Text
version String @default("KJV")
chapter BibleChapter @relation(fields: [chapterId], references: [id])
bookmarks Bookmark[]
notes Note[]
@@unique([chapterId, verseNum, version])
@@unique([chapterId, verseNum])
@@index([chapterId])
@@index([version])
}
model BiblePassage {
@@ -89,7 +111,7 @@ model BiblePassage {
translation String @default("FIDELA")
textRaw String @db.Text
textNorm String @db.Text // Normalized text for embedding
embedding Unsupported("vector(3072)")?
embedding String? // Will be changed to vector later when extension is available
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@ -170,7 +192,7 @@ model Prayer {
model ReadingHistory {
id String @id @default(uuid())
userId String
bookId Int
bookId String
chapterNum Int
verseNum Int?
viewedAt DateTime @default(now())