save avant prochaine modif
This commit is contained in:
5
prisma/.env
Normal file
5
prisma/.env
Normal file
@@ -0,0 +1,5 @@
|
||||
# Connexion locale via le Docker Compose fourni :
|
||||
DATABASE_URL=postgresql://admin:adminpassword@kaelstudio.tech:5432/afropreunariat_dev?schema=public
|
||||
|
||||
# Exemple avec Supabase ou Neon (si base distante)
|
||||
# DATABASE_URL="postgresql://postgres:[MOT_DE_PASSE]@db.[ID_PROJET].supabase.co:5432/postgres"
|
||||
120
prisma/schema.prisma
Normal file
120
prisma/schema.prisma
Normal file
@@ -0,0 +1,120 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
}
|
||||
|
||||
enum UserRole {
|
||||
VISITOR
|
||||
ENTREPRENEUR
|
||||
ADMIN
|
||||
}
|
||||
|
||||
model User {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
email String @unique
|
||||
role UserRole @default(VISITOR)
|
||||
avatar String?
|
||||
|
||||
businesses Business[]
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model Business {
|
||||
id String @id @default(uuid())
|
||||
name String
|
||||
category String
|
||||
location String
|
||||
description String @db.Text
|
||||
logoUrl String
|
||||
videoUrl String?
|
||||
|
||||
// Contact & Social
|
||||
contactEmail String
|
||||
contactPhone String?
|
||||
// We use JSON to store social links (facebook, linkedin, instagram, website)
|
||||
socialLinks Json?
|
||||
|
||||
// Stats
|
||||
verified Boolean @default(false)
|
||||
viewCount Int @default(0)
|
||||
rating Float @default(0.0)
|
||||
tags String[]
|
||||
|
||||
// Entrepreneur of the Month fields
|
||||
isFeatured Boolean @default(false)
|
||||
founderName String?
|
||||
founderImageUrl String?
|
||||
keyMetric String?
|
||||
|
||||
// Relations
|
||||
ownerId String
|
||||
owner User @relation(fields: [ownerId], references: [id])
|
||||
offers Offer[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
enum OfferType {
|
||||
PRODUCT
|
||||
SERVICE
|
||||
}
|
||||
|
||||
model Offer {
|
||||
id String @id @default(uuid())
|
||||
title String
|
||||
type OfferType
|
||||
price Float
|
||||
currency String @default("XOF") // EUR or XOF
|
||||
description String? @db.Text
|
||||
imageUrl String
|
||||
active Boolean @default(true)
|
||||
|
||||
// Relations
|
||||
businessId String
|
||||
business Business @relation(fields: [businessId], references: [id], onDelete: Cascade)
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model BlogPost {
|
||||
id String @id @default(uuid())
|
||||
title String
|
||||
excerpt String @db.Text
|
||||
content String @db.Text
|
||||
author String
|
||||
date DateTime @default(now())
|
||||
imageUrl String
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
enum InterviewType {
|
||||
VIDEO
|
||||
ARTICLE
|
||||
}
|
||||
|
||||
model Interview {
|
||||
id String @id @default(uuid())
|
||||
title String
|
||||
guestName String
|
||||
companyName String
|
||||
role String
|
||||
type InterviewType
|
||||
thumbnailUrl String
|
||||
videoUrl String?
|
||||
content String? @db.Text
|
||||
excerpt String @db.Text
|
||||
date DateTime @default(now())
|
||||
duration String? // "15 min" ou "5 min de lecture"
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
Reference in New Issue
Block a user