Untitled

 avatar
unknown
plain_text
2 years ago
2.0 kB
5
Indexable
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

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

}

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


// emuns

enum StreamType {
  OwnStream
  Restricted
  M3u8
  Web
}

enum VideoType {
  None
  Youtube
  Sportmonk
}

enum ThumbnailType {
  None
  Url
  Image
}

model User {
  id String @id @default(auto()) @map("_id") @db.ObjectId
  name String?
  email String @unique
  password String 
  adminType String?
  emailVerified DateTime?
  image String?
  createdAt DateTime @default(now())
  updatedAt DateTime @updatedAt
}


model Match {
  id String @id @default(auto()) @map("_id") @db.ObjectId
  fixtureId       String?
  matchTime       String  
  matchTitle      String    
  teamOneName     String    
  teamOneImage    String    
  teamTwoName     String    
  teamTwoImage    String
  matchStatus     Boolean   
  streamingSources Stream[]
}



model Stream {
  id String @id @default(auto()) @map("_id") @db.ObjectId
  matchId String @db.ObjectId
  streamTitle       String   
  isPremium         Boolean  
  resulation        String   
  platform          String
  portraitWatermark String  
  landscapeWatermark String 
  streamType        StreamType @default(OwnStream)   
  streamUrl         String?   
  headers           String?
  streamKey         String? 
  streamRestrictedData   String?

  match  Match  @relation(fields: [matchId], references: [id], onDelete: Cascade, onUpdate: Cascade)
}


model Highlight {
  id String @id @default(auto()) @map("_id") @db.ObjectId
  fixtureId String?
  title String
  shortDescription String?
  status Boolean
  youtubeUrl String?
  youtubeThumbnail String?
  videoType VideoType @default(None)
  thumbnailType ThumbnailType @default(None)
  imageUrl String?
  imageFile String?
}
Editor is loading...