first commit
This commit is contained in:
@@ -0,0 +1,162 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
}
|
||||
|
||||
enum Role {
|
||||
ADMIN
|
||||
USER
|
||||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(cuid())
|
||||
name String?
|
||||
email String @unique
|
||||
password String?
|
||||
role Role @default(USER)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
deletedAt DateTime?
|
||||
accounts Account[]
|
||||
sessions Session[]
|
||||
}
|
||||
|
||||
model Account {
|
||||
id String @id @default(cuid())
|
||||
userId String
|
||||
type String
|
||||
provider String
|
||||
providerAccountId String
|
||||
refresh_token String? @db.Text
|
||||
access_token String? @db.Text
|
||||
expires_at Int?
|
||||
token_type String?
|
||||
scope String?
|
||||
id_token String? @db.Text
|
||||
session_state String?
|
||||
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([provider, providerAccountId])
|
||||
}
|
||||
|
||||
model Session {
|
||||
id String @id @default(cuid())
|
||||
sessionToken String @unique
|
||||
userId String
|
||||
expires DateTime
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model VerificationToken {
|
||||
identifier String
|
||||
token String @unique
|
||||
expires DateTime
|
||||
|
||||
@@unique([identifier, token])
|
||||
}
|
||||
|
||||
model Category {
|
||||
id String @id @default(cuid())
|
||||
name String @unique
|
||||
slug String @unique
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model Lesson {
|
||||
id String @id @default(cuid())
|
||||
slug String @unique
|
||||
title String
|
||||
youtubeId String
|
||||
youtubeUrl String
|
||||
thumbnailUrl String
|
||||
duration String
|
||||
publishDate DateTime @default(now())
|
||||
category String
|
||||
tags String[]
|
||||
viewsCount Int @default(0)
|
||||
downloadCount Int @default(0)
|
||||
likesCount Int @default(0)
|
||||
summary String @db.Text
|
||||
notesMarkdown String[]
|
||||
isFeatured Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
codeSnippets CodeSnippet[]
|
||||
downloads ResourceDownload[]
|
||||
chapters VideoChapter[]
|
||||
}
|
||||
|
||||
model CodeSnippet {
|
||||
id String @id @default(cuid())
|
||||
fileName String
|
||||
language String
|
||||
code String @db.Text
|
||||
description String?
|
||||
lessonId String
|
||||
lesson Lesson @relation(fields: [lessonId], references: [id], onDelete: Cascade)
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model ResourceDownload {
|
||||
id String @id @default(cuid())
|
||||
title String
|
||||
type String // zip, github, pdf, link
|
||||
url String
|
||||
size String?
|
||||
lessonId String
|
||||
lesson Lesson @relation(fields: [lessonId], references: [id], onDelete: Cascade)
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model VideoChapter {
|
||||
id String @id @default(cuid())
|
||||
time String
|
||||
seconds Int
|
||||
title String
|
||||
lessonId String
|
||||
lesson Lesson @relation(fields: [lessonId], references: [id], onDelete: Cascade)
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model Cheatsheet {
|
||||
id String @id @default(cuid())
|
||||
slug String @unique
|
||||
title String
|
||||
category String
|
||||
description String @db.Text
|
||||
tags String[]
|
||||
lastUpdated DateTime @default(now())
|
||||
createdAt DateTime @default(now())
|
||||
items CheatsheetItem[]
|
||||
}
|
||||
|
||||
model CheatsheetItem {
|
||||
id String @id @default(cuid())
|
||||
command String
|
||||
description String
|
||||
example String?
|
||||
cheatsheetId String
|
||||
cheatsheet Cheatsheet @relation(fields: [cheatsheetId], references: [id], onDelete: Cascade)
|
||||
}
|
||||
|
||||
model ContactMessage {
|
||||
id String @id @default(cuid())
|
||||
name String
|
||||
email String
|
||||
subject String
|
||||
message String @db.Text
|
||||
isRead Boolean @default(false)
|
||||
createdAt DateTime @default(now())
|
||||
}
|
||||
|
||||
model Setting {
|
||||
id String @id @default(cuid())
|
||||
key String @unique
|
||||
value String @db.Text
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
Reference in New Issue
Block a user