phase 1 backend
This commit is contained in:
parent
a0897c2d38
commit
9653e55453
26 changed files with 3225 additions and 0 deletions
|
@ -0,0 +1,35 @@
|
|||
-- CreateTable
|
||||
CREATE TABLE "User" (
|
||||
"id" SERIAL NOT NULL,
|
||||
"email" TEXT NOT NULL,
|
||||
"name" TEXT,
|
||||
|
||||
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "JobOffer" (
|
||||
"id" TEXT NOT NULL,
|
||||
"title" TEXT NOT NULL,
|
||||
"description" TEXT NOT NULL,
|
||||
"dateCreation" TIMESTAMP(3) NOT NULL,
|
||||
"romeCode" TEXT,
|
||||
"romeLabel" TEXT,
|
||||
"lieuTravailLibelle" TEXT,
|
||||
"postalCode" TEXT,
|
||||
"departmentCode" TEXT,
|
||||
"cityName" TEXT,
|
||||
"entrepriseNom" TEXT,
|
||||
"contractType" TEXT,
|
||||
"contractLabel" TEXT,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "JobOffer_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "JobOffer_id_key" ON "JobOffer"("id");
|
3
backend/prisma/migrations/migration_lock.toml
Normal file
3
backend/prisma/migrations/migration_lock.toml
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Please do not edit this file manually
|
||||
# It should be added in your version-control system (e.g., Git)
|
||||
provider = "postgresql"
|
56
backend/prisma/schema.prisma
Normal file
56
backend/prisma/schema.prisma
Normal file
|
@ -0,0 +1,56 @@
|
|||
// 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
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
email String @unique
|
||||
name String?
|
||||
}
|
||||
|
||||
model JobOffer {
|
||||
// Identifiant unique de l'offre (celui de l'API France Travail)
|
||||
id String @id @unique
|
||||
|
||||
// Informations principales
|
||||
title String
|
||||
description String @db.Text // Utiliser Text pour de longues descriptions
|
||||
publicationDate DateTime @map("dateCreation") // La date de création de l'offre, mappée du champ de l'API
|
||||
romeCode String? // Code ROME (peut être optionnel si non toujours présent)
|
||||
romeLabel String? // Libellé du code ROME
|
||||
|
||||
// Informations sur le lieu de travail
|
||||
locationLabel String? @map("lieuTravailLibelle") // ex: "Paris (75)" ou "Lyon (69)"
|
||||
postalCode String?
|
||||
departmentCode String?
|
||||
cityName String?
|
||||
|
||||
// Informations sur l'entreprise
|
||||
companyName String? @map("entrepriseNom") // Nom de l'entreprise (peut être non renseigné)
|
||||
|
||||
// Type de contrat
|
||||
contractType String?
|
||||
contractLabel String? // Libellé du type de contrat
|
||||
|
||||
// Autres champs pertinents si tu les as identifiés dans l'API et que tu souhaites les stocker
|
||||
// Par exemple:
|
||||
// duration String? // Durée du contrat
|
||||
// offerUrl String? // URL directe de l'offre sur France Travail
|
||||
|
||||
// Champs de métadonnées pour notre base de données
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
// Tu pourras ajouter des relations ici plus tard (ex: avec un modèle User ou Favorite)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue