init
This commit is contained in:
53
backend/prisma/schema.prisma
Normal file
53
backend/prisma/schema.prisma
Normal file
@@ -0,0 +1,53 @@
|
||||
// This is your Prisma schema file,
|
||||
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
||||
|
||||
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
|
||||
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
username String @unique
|
||||
email String @unique
|
||||
password String
|
||||
type String
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
ofertas Oferta[]
|
||||
postulaciones UserOferta[]
|
||||
}
|
||||
|
||||
model UserOferta {
|
||||
id Int @id @default(autoincrement())
|
||||
userId Int
|
||||
ofertaId Int
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
oferta Oferta @relation(fields: [ofertaId], references: [id])
|
||||
|
||||
@@unique([userId, ofertaId])
|
||||
}
|
||||
|
||||
model Oferta {
|
||||
id Int @id @default(autoincrement())
|
||||
titulo String
|
||||
empresa String
|
||||
ubicacion String
|
||||
salario String @default("0")
|
||||
contrato String
|
||||
descripcion String
|
||||
url String
|
||||
authorId Int
|
||||
|
||||
author User @relation(fields: [authorId], references: [id])
|
||||
candidatos UserOferta[]
|
||||
}
|
||||
Reference in New Issue
Block a user