Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.6 kB
7
Indexable
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "mysql"
  url      = env("DATABASE_URL")
}

enum Roles {
  user
  admin
}

model User {
  id        Int      @id @default(autoincrement())
  email     String   @unique @db.VarChar(255)
  password  String   @db.VarChar(255)
  role      Roles    @default(user)
  createdAt DateTime @default(now())
}

model Category {
  id          Int     @id @default(autoincrement())
  title       String  @db.VarChar(255)
  description String  @db.VarChar(255)
  icon        String? @db.VarChar(255)
}

enum LevelPosts {
  beginner
  amateur
  expert
}

model Posts {
  id             Int         @id @default(autoincrement())
  subject        String      @db.VarChar(255)
  subject_url    String?     @default("") @db.LongText
  description       String?     @default("") @db.LongText
  level          LevelPosts? @default(beginner)
  technology     Technos?    @default(html)
  author_name    String?     @default("")
  author_profile String?     @default("")
  public         Boolean?    @default(false)
  publishedAt    DateTime    @default(now())
  editAt         DateTime    @default(now())
}

enum Technos {
  react
  html
  css
  javascript
  php
}

model Comments {
  id          Int      @id
  subject     String   @db.VarChar(255)
  displayName String?  @default("")
  profile_id  Int?     @default(0)
  content     String   @db.LongText
  postedAt    DateTime @default(now())
  editAt      DateTime @updatedAt
}