generator client {
  provider = "prisma-client"
  output   = "../src/generated/prisma"
}

datasource db {
  provider = "mysql"
}

model about {
  id          Int      @id @default(autoincrement())
  badge       String?
  title       String
  highlight   String?
  description String?  @db.Text
  photo       String?
  active      Boolean  @default(true)
  createdAt   DateTime @default(now())
  updatedAt   DateTime
  email       String?
  facebook    String?
  github      String?
  instagram   String?
  tiktok      String?
  twitter     String?
}

model aboutstat {
  id        Int      @id @default(autoincrement())
  label     String
  value     String
  icon      String?
  active    Boolean  @default(true)
  sortOrder Int      @default(0)
  createdAt DateTime @default(now())
  updatedAt DateTime
}

model achievement {
  id               Int                @id @default(autoincrement())
  title            String
  issuer           String?
  date             DateTime?
  description      String?            @db.Text
  image            String?
  url              String?
  createdAt        DateTime           @default(now())
  updatedAt        DateTime
  achievementimage achievementimage[]
}

model achievementimage {
  id            Int         @id @default(autoincrement())
  image         String
  achievementId Int
  createdAt     DateTime    @default(now())
  achievement   achievement @relation(fields: [achievementId], references: [id], onDelete: Cascade, map: "AchievementImage_achievementId_fkey")

  @@index([achievementId], map: "AchievementImage_achievementId_fkey")
}

model article {
  id           Int            @id @default(autoincrement())
  title        String
  slug         String         @unique(map: "Article_slug_key")
  excerpt      String?        @db.Text
  content      String         @db.LongText
  thumbnail    String?
  category     String?
  published    Boolean        @default(false)
  publishedAt  DateTime?
  createdAt    DateTime       @default(now())
  updatedAt    DateTime
  authorId     String?
  author       user?          @relation(fields: [authorId], references: [id])
  articleimage articleimage[]

  @@index([authorId], map: "article_authorId_fkey")
}

model articleimage {
  id        Int      @id @default(autoincrement())
  image     String
  articleId Int
  createdAt DateTime @default(now())
  article   article  @relation(fields: [articleId], references: [id], onDelete: Cascade)

  @@index([articleId])
}

model certification {
  id                 Int                  @id @default(autoincrement())
  name               String
  issuer             String
  credentialId       String?
  issueDate          DateTime
  expiryDate         DateTime?
  image              String?
  description        String?              @db.Text
  createdAt          DateTime             @default(now())
  updatedAt          DateTime
  certificationimage certificationimage[]
}

model certificationimage {
  id              Int           @id @default(autoincrement())
  image           String
  certificationId Int
  createdAt       DateTime      @default(now())
  certification   certification @relation(fields: [certificationId], references: [id], onDelete: Cascade, map: "CertificationImage_certificationId_fkey")

  @@index([certificationId], map: "CertificationImage_certificationId_fkey")
}

model contact {
  id        Int      @id @default(autoincrement())
  name      String
  email     String
  subject   String?
  message   String   @db.Text
  isRead    Boolean  @default(false)
  createdAt DateTime @default(now())
}

model contactinfo {
  id          Int      @id @default(autoincrement())
  description String?  @db.Text
  email       String?
  phone       String?
  location    String?
  website     String?
  github      String?
  linkedin    String?
  active      Boolean  @default(true)
  createdAt   DateTime @default(now())
  updatedAt   DateTime
  facebook    String?
  instagram   String?
  tiktok      String?
  twitter     String?
  youtube     String?
}

model education {
  id          Int       @id @default(autoincrement())
  institution String
  degree      String
  field       String?
  startDate   DateTime
  endDate     DateTime?
  description String?   @db.Text
  createdAt   DateTime  @default(now())
  updatedAt   DateTime
}

model experience {
  id          Int             @id @default(autoincrement())
  type        experience_type
  position    String
  company     String
  location    String?
  startDate   DateTime
  endDate     DateTime?
  isCurrent   Boolean         @default(false)
  description String?         @db.Text
  logo        String?
  createdAt   DateTime        @default(now())
  updatedAt   DateTime
}

model gallery {
  id           Int            @id @default(autoincrement())
  title        String
  description  String?        @db.Text
  image        String
  category     String?
  projectId    Int?
  createdAt    DateTime       @default(now())
  updatedAt    DateTime
  project      project?       @relation(fields: [projectId], references: [id], map: "Gallery_projectId_fkey")
  galleryimage galleryimage[]

  @@index([projectId], map: "Gallery_projectId_fkey")
}

model galleryimage {
  id        Int      @id @default(autoincrement())
  image     String
  galleryId Int
  createdAt DateTime @default(now())
  gallery   gallery  @relation(fields: [galleryId], references: [id], onDelete: Cascade, map: "GalleryImage_galleryId_fkey")

  @@index([galleryId], map: "GalleryImage_galleryId_fkey")
}

model hero {
  id                  Int         @id @default(autoincrement())
  badge               String?
  title               String
  highlight           String?
  description         String?     @db.Text
  primaryButtonText   String?
  primaryButtonUrl    String?
  secondaryButtonText String?
  secondaryButtonUrl  String?
  photo               String?
  githubUrl           String?
  linkedinUrl         String?
  email               String?
  active              Boolean     @default(true)
  createdAt           DateTime    @default(now())
  updatedAt           DateTime
  cv                  String?
  heroimage           heroimage[]
}

model heroimage {
  id        Int      @id @default(autoincrement())
  image     String
  heroId    Int
  createdAt DateTime @default(now())
  hero      hero     @relation(fields: [heroId], references: [id], onDelete: Cascade)

  @@index([heroId])
}

model profile {
  id        Int      @id @default(autoincrement())
  name      String
  title     String?
  bio       String?  @db.Text
  email     String?
  phone     String?
  location  String?
  photo     String?
  github    String?
  linkedin  String?
  website   String?
  cvUrl     String?
  createdAt DateTime @default(now())
  updatedAt DateTime
}

model project {
  id           Int            @id @default(autoincrement())
  title        String
  slug         String         @unique(map: "Project_slug_key")
  description  String?        @db.Text
  image        String?
  technologies String?        @db.Text
  startDate    DateTime?
  endDate      DateTime?
  featured     Boolean        @default(false)
  createdAt    DateTime       @default(now())
  updatedAt    DateTime
  projectUrl   String?
  gallery      gallery[]
  projectimage projectimage[]
}

model projectimage {
  id        Int      @id @default(autoincrement())
  image     String
  projectId Int
  createdAt DateTime @default(now())
  project   project  @relation(fields: [projectId], references: [id], onDelete: Cascade, map: "ProjectImage_projectId_fkey")

  @@index([projectId], map: "ProjectImage_projectId_fkey")
}

model service {
  id          Int      @id @default(autoincrement())
  title       String
  slug        String   @unique(map: "Service_slug_key")
  description String?  @db.Text
  icon        String?
  image       String?
  featured    Boolean  @default(false)
  active      Boolean  @default(true)
  createdAt   DateTime @default(now())
  updatedAt   DateTime
}

model skill {
  id        Int      @id @default(autoincrement())
  name      String
  category  String?
  level     Int?
  icon      String?
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
}

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, map: "Account_userId_fkey")

  @@unique([provider, providerAccountId], map: "Account_provider_providerAccountId_key")
  @@index([userId], map: "Account_userId_idx")
}

model admin {
  id           Int      @id @default(autoincrement())
  username     String   @unique(map: "Admin_username_key")
  passwordHash String
  active       Boolean  @default(true)
  createdAt    DateTime @default(now())
  updatedAt    DateTime
}

model contactformusage {
  id            String   @id
  userId        String   @unique(map: "ContactFormUsage_userId_key")
  remainingUses Int      @default(3)
  active        Boolean  @default(true)
  createdAt     DateTime @default(now())
  updatedAt     DateTime
  user          user     @relation(fields: [userId], references: [id], onDelete: Cascade, map: "ContactFormUsage_userId_fkey")

  @@index([userId], map: "ContactFormUsage_userId_idx")
}

model session {
  id           String   @id @default(cuid())
  sessionToken String   @unique(map: "Session_sessionToken_key")
  userId       String
  expires      DateTime
  user         user     @relation(fields: [userId], references: [id], onDelete: Cascade)

  @@index([userId], map: "Session_userId_idx")
}

model user {
  id               String            @id @default(cuid())
  name             String?
  email            String?           @unique(map: "User_email_key")
  emailVerified    DateTime?
  image            String?
  createdAt        DateTime          @default(now())
  updatedAt        DateTime          @default(now())
  articleAccess    Boolean           @default(true)
  account          account[]
  articles         article[]
  contactformusage contactformusage?
  session          session[]
}

model verificationtoken {
  identifier String
  token      String   @unique(map: "VerificationToken_token_key")
  expires    DateTime

  @@unique([identifier, token], map: "VerificationToken_identifier_token_key")
}

enum experience_type {
  WORK
  INTERNSHIP
}
