You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
102 lines
2.4 KiB
102 lines
2.4 KiB
generator client {
|
|
provider = "prisma-client-js"
|
|
}
|
|
|
|
datasource db {
|
|
provider = "postgresql"
|
|
url = env("DATABASE_URL")
|
|
}
|
|
|
|
model Account {
|
|
id Int @id @default(autoincrement())
|
|
userId Int @map("user_id")
|
|
type String
|
|
provider String
|
|
providerAccountId String @map("provider_account_id")
|
|
refresh_token String?
|
|
access_token String?
|
|
expires_at Int?
|
|
token_type String?
|
|
scope String?
|
|
id_token String?
|
|
session_state String?
|
|
oauth_token_secret String?
|
|
oauth_token String?
|
|
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
@@unique([provider, providerAccountId])
|
|
@@map("accounts")
|
|
}
|
|
|
|
model Session {
|
|
id Int @id @default(autoincrement())
|
|
sessionToken String @unique @map("session_token")
|
|
userId Int @map("user_id")
|
|
expires DateTime
|
|
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
|
|
@@map("sessions")
|
|
}
|
|
|
|
model User {
|
|
id Int @id @default(autoincrement())
|
|
name String?
|
|
surname String?
|
|
address String?
|
|
zipCode Int?
|
|
phoneNumber Int?
|
|
email String? @unique
|
|
emailVerified DateTime? @map("email_verified")
|
|
image String?
|
|
createdAt DateTime @default(now()) @map(name: "created_at")
|
|
updatedAt DateTime @updatedAt @map(name: "updated_at")
|
|
accounts Account[]
|
|
sessions Session[]
|
|
gain Gain[]
|
|
role Role @default(USER)
|
|
|
|
@@map(name: "users")
|
|
}
|
|
|
|
model TicketsRestants {
|
|
id Int @id @default(autoincrement())
|
|
total Int
|
|
}
|
|
|
|
model Gain {
|
|
id Int @id @default(autoincrement())
|
|
codeCadeau String @unique
|
|
dateRetrait DateTime?
|
|
produit Produit? @relation(fields: [produitId], references: [id])
|
|
produitId Int?
|
|
user User? @relation(fields: [userId], references: [id])
|
|
userId Int?
|
|
actif Boolean @default(true)
|
|
}
|
|
|
|
model Produit {
|
|
id Int @id @default(autoincrement())
|
|
actif Boolean?
|
|
nomProduit String?
|
|
prixTtc Int?
|
|
image String?
|
|
description String?
|
|
refGain Gain[]
|
|
}
|
|
|
|
enum Role {
|
|
USER
|
|
ADMIN
|
|
SUPERADMIN
|
|
}
|
|
|
|
model VerificationToken {
|
|
identifier String
|
|
token String @unique
|
|
expires DateTime
|
|
|
|
@@unique([identifier, token])
|
|
@@map("verificationtokens")
|
|
}
|