Untitled
unknown
plain_text
a year ago
51 kB
2
Indexable
Never
generator client { provider = "prisma-client-js" previewFeatures = ["views"] } datasource db { provider = "postgresql" url = env("DATABASE_POSTGRES_URL") } model Acheteur { id Int @id @default(autoincrement()) nom String @unique @db.VarChar(255) adresse String @db.VarChar(255) code_postal String @db.VarChar(255) commune String @db.VarChar(255) telephone String? @db.VarChar(255) mail String? @db.VarChar(255) mails_complementaires String[] @default(dbgenerated("(ARRAY[]::character varying[])::character varying(255)[]")) @db.VarChar(255) numero_tva String @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) contrats_achats ContratAchat[] @@map("Acheteurs") } model Agence { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrales Centrale[] @@map("Agences") } model Alerte { id Int @id @default(autoincrement()) details Json? id_statut_alerte Int? id_type_alerte Int? id_criticite Int? code_centrale Int? key_jira String? @unique @db.VarChar(255) id_issue Int? createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrale Centrale? @relation(fields: [code_centrale], references: [code_centrale], onDelete: NoAction) criticite Criticite? @relation(fields: [id_criticite], references: [id], onDelete: NoAction) issue Issue? @relation(fields: [id_issue], references: [id], onDelete: NoAction) statut_alerte StatutAlerte? @relation(fields: [id_statut_alerte], references: [id], onDelete: NoAction) type_alerte TypeAlerte? @relation(fields: [id_type_alerte], references: [id], onDelete: NoAction) @@map("Alertes") } model Arret { month String @db.VarChar(255) duration Decimal? @db.Decimal id_type_arret Int code_centrale Int createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: NoAction) type_arret TypeArret @relation(fields: [id_type_arret], references: [id], onDelete: NoAction) @@id([month, id_type_arret, code_centrale]) @@map("Arrets") } model Article { reference String @db.VarChar(255) specs Json? id_type_article Int id_marque Int? createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) marque Marque? @relation(fields: [id_marque], references: [id], onDelete: NoAction) type_article TypeArticle @relation(fields: [id_type_article], references: [id], onDelete: NoAction) @@id([reference, id_type_article]) @@map("Articles") } model Automaticien { mail_user String @id @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) user User @relation(fields: [mail_user], references: [mail], onDelete: NoAction) CentraleAutomaticiens CentraleAutomaticien[] @@map("Automaticiens") } model Cardi { numero String @id @db.VarChar(255) id_type_cardi Int code_centrale Int createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: NoAction) type_cardi TypeCardi @relation(fields: [id_type_cardi], references: [id], onDelete: NoAction) ConsoCompteurEnedis ConsoCompteurEnedis[] ProductionCompteurEnedis ProductionCompteurEnedis[] @@map("Cardis") } model CentraleAutomaticien { mail_user String @db.VarChar(255) code_centrale Int createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) Centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: Cascade) Automaticien Automaticien @relation(fields: [mail_user], references: [mail_user], onDelete: Cascade) @@id([mail_user, code_centrale]) @@map("CentraleAutomaticiens") } model CentraleChefProjet { mail_user String @db.VarChar(255) code_centrale Int createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) Centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: Cascade) ChefProjet ChefProjet @relation(fields: [mail_user], references: [mail_user], onDelete: Cascade) @@id([mail_user, code_centrale]) @@map("CentraleChefProjets") } model CentraleTypePanneau { id_type_panneau Int code_centrale Int createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) Centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: Cascade) TypePanneau TypePanneau @relation(fields: [id_type_panneau], references: [id], onDelete: Cascade) @@id([id_type_panneau, code_centrale]) @@map("CentraleTypePanneaus") } model CentraleTypeStructure { id_type_structure Int code_centrale Int createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) Centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: Cascade) TypeStructure TypeStructure @relation(fields: [id_type_structure], references: [id], onDelete: Cascade) @@id([id_type_structure, code_centrale]) @@map("CentraleTypeStructure") } model Centrale { code_centrale Int @id code_projet String? @db.VarChar(255) nom String @db.VarChar(255) code_postal String? @db.VarChar(255) commune String? @db.VarChar(255) voie String? @db.VarChar(255) pays String? @db.VarChar(255) puissance_crete Decimal? @db.Decimal puissance_installee Decimal? @db.Decimal recouplage_en_astreinte Boolean? portefeuille String? @db.VarChar(255) president_spv String? @db.VarChar(255) libelle_producteur String? @db.VarChar(255) date_msi DateTime? @db.Date timezone String? @db.VarChar(255) latitude Decimal? @db.Decimal longitude Decimal? @db.Decimal ventilation Json? production_reference Decimal? @db.Decimal taux_decroissance Decimal? @db.Decimal id_contrat Int? mail_charge_exploitation String? @db.VarChar(255) acronyme_zone String? @db.VarChar(255) id_type_modem Int? id_type_datalogger Int? domaine_tension String? @db.VarChar(255) typologie String? @db.VarChar(255) raccordement String? @db.VarChar(255) numero_ligne String? @db.VarChar(255) numero_ligne_comptage String? @db.VarChar(255) adresse_ip String? @db.VarChar(255) numero_compteur String? @db.VarChar(255) cle_courbe_charge String? @db.VarChar(255) moyen_acces String? position_equipements String? consignes_particulieres String? id_agence Int? last_mp DateTime? @db.Date next_mp DateTime? @db.Date interval_mp Int? id_equipe_mp Int? numero_societe_producteur String? @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) deletedAt DateTime? @db.Timestamptz(6) alertes Alerte[] arrets Arret[] Cardis Cardi[] CentraleAutomaticiens CentraleAutomaticien[] CentraleChefProjets CentraleChefProjet[] CentraleTypePanneaus CentraleTypePanneau[] CentraleTypeStructures CentraleTypeStructure[] zone Zone? @relation(fields: [acronyme_zone], references: [acronyme], onDelete: NoAction) Agence Agence? @relation(fields: [id_agence], references: [id], onDelete: Cascade) contrat Contrat? @relation(fields: [id_contrat], references: [id], onDelete: NoAction) EquipeMp EquipeMp? @relation(fields: [id_equipe_mp], references: [id], onDelete: NoAction) type_datalogger TypeDatalogger? @relation(fields: [id_type_datalogger], references: [id], onDelete: NoAction) type_modem TypeModem? @relation(fields: [id_type_modem], references: [id], onDelete: NoAction) charge_exploitation ChargeExploitation? @relation(fields: [mail_charge_exploitation], references: [mail_user], onDelete: NoAction) Producteur Producteur? @relation(fields: [numero_societe_producteur], references: [numero_societe], onDelete: NoAction) ConfigurationTypeAlerteCentrales ConfigurationTypeAlerteCentrale[] conso_compteurs ConsoCompteur[] contrat_achat ContratAchat? Defauts Defaut[] ghi_bps GhiBp[] GhiPrevisionnels GhiPrevisionnel[] GhiReels GhiReel[] GroupeCentrales GroupeCentrale[] issues Issue[] onduleurs Onduleur[] ProductionBps ProductionBp[] production_compteurs ProductionCompteur[] production_onduleurs ProductionOnduleur[] RapportProductions RapportProduction[] Rapports Rapport[] TarifFacturations TarifFacturation[] TechnoCentrales TechnoCentrale[] temperature_reelles TemperatureReelle[] ConsoCompteurEnedis ConsoCompteurEnedis[] ProductionCompteurEnedis ProductionCompteurEnedis[] workOrders WorkOrder[] @@map("Centrales") } model ChargeExploitation { mail_user String @id @db.VarChar(255) photo String? @db.VarChar(255) poste String? @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrales Centrale[] user User @relation(fields: [mail_user], references: [mail], onDelete: NoAction) recherches Recherche[] @@map("ChargeExploitations") } model ChefProjet { mail_user String @id @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) CentraleChefProjets CentraleChefProjet[] user User @relation(fields: [mail_user], references: [mail], onDelete: NoAction) @@map("ChefProjets") } model Client { mail_user String @id @db.VarChar(255) tel_mobile String? @db.VarChar(255) tel_fixe String? @db.VarChar(255) activation_expiration DateTime? @db.Timestamptz(6) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) user User @relation(fields: [mail_user], references: [mail], onDelete: NoAction) @@map("Clients") } model ConfigurationTypeAlerteCentrale { code_centrale Int id_type_alerte Int disabled DateTime? @db.Timestamptz(6) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) Centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: Cascade) TypeAlerte TypeAlerte @relation(fields: [id_type_alerte], references: [id], onDelete: NoAction) @@id([code_centrale, id_type_alerte]) @@map("ConfigurationTypeAlerteCentrales") } model ConsoCompteur { code_centrale Int month String @db.VarChar(255) enedis_value Decimal? @db.Decimal streem_value Decimal? @db.Decimal createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: Cascade) @@id([code_centrale, month]) @@map("ConsoCompteurs") } model ConsoCompteurEnedis { code_centrale Int month String @db.VarChar(255) numero_cardi String enedis_value Decimal? @db.Decimal createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: Cascade) cardi Cardi @relation(fields: [numero_cardi], references: [numero], onDelete: Cascade) @@id([code_centrale, month, numero_cardi]) @@map("ConsoCompteurEnedis") } model ContratAchatTarifIndice { id Int @id @default(autoincrement()) year Int? @unique fmoa Decimal @db.Decimal icht Decimal @db.Decimal createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) @@map("ContratAchatTarifIndices") } model ContratAchat { numero String @id @db.VarChar(255) date_begin DateTime? @db.Date date_end DateTime? @db.Date periodicity String? @db.VarChar(255) tarif Decimal? @db.Decimal reference_price Decimal? @db.Decimal fmoa Decimal? @db.Decimal icht Decimal? @db.Decimal energy_limit Int? deducted_conso Boolean? date_production DateTime? @db.Date montant_a_facturer String? @db.VarChar(255) code_centrale Int? @unique numero_societe_producteur String? @db.VarChar(255) id_type_contrat_achat Int? id_source_data Int? id_acheteur Int? id_model_facture Int? createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) deletedAt DateTime? @db.Timestamptz(6) centrale Centrale? @relation(fields: [code_centrale], references: [code_centrale], onDelete: Cascade) acheteur Acheteur? @relation(fields: [id_acheteur], references: [id], onDelete: Cascade) model_facture ModelFacture? @relation(fields: [id_model_facture], references: [id], onDelete: NoAction) source_data SourceData? @relation(fields: [id_source_data], references: [id], onDelete: NoAction) type_contrat_achat TypeContratAchat? @relation(fields: [id_type_contrat_achat], references: [id], onDelete: NoAction) producteur Producteur? @relation(fields: [numero_societe_producteur], references: [numero_societe], onDelete: NoAction) data_aggregators DataAggregator[] FactureArchivees FactureArchivee[] factures Facture[] @@map("ContratAchats") } model ContratTypeContrat { id_type_contrat Int id_contrat Int createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) Contrat Contrat @relation(fields: [id_contrat], references: [id], onDelete: Cascade) TypeContrat TypeContrat @relation(fields: [id_type_contrat], references: [id], onDelete: Cascade) @@id([id_type_contrat, id_contrat]) @@map("ContratTypeContrats") } model Contrat { id Int @id @default(autoincrement()) numero String? @unique @db.VarChar(255) date_effet DateTime? @db.Date mail_responsable String? @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) deletedAt DateTime? @db.Timestamptz(6) centrales Centrale[] ContratTypeContrats ContratTypeContrat[] @@map("Contrats") } model Criticite { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) alertes Alerte[] @@map("Criticites") } model DataAggregator { month DateTime @db.Date quantite_prod_rte Decimal? @db.Decimal prix_unitaire_rte Decimal? @db.Decimal amount_rte Decimal? @db.Decimal quantite_prod_mo Decimal? @db.Decimal prix_unitaire_mo Decimal? @db.Decimal amount_mo Decimal? @db.Decimal quantite_frais_gestion Decimal? @db.Decimal prix_unitaire_frais_gestion Decimal? @db.Decimal amount_frais_gestion Decimal? @db.Decimal quantite_penalite Decimal? @db.Decimal prix_unitaire_penalite Decimal? @db.Decimal amount_frais_penalite Decimal? @db.Decimal numero_contrat_achat String @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) contrat_achat ContratAchat @relation(fields: [numero_contrat_achat], references: [numero], onDelete: Cascade) @@id([month, numero_contrat_achat]) @@map("DataAggregators") } model Defaut { month_begin String @db.VarChar(255) month_end String? @db.VarChar(255) impact Decimal? @db.Decimal id_type_defaut Int code_centrale Int createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: NoAction) type_defaut TypeDefaut @relation(fields: [id_type_defaut], references: [id], onDelete: NoAction) @@id([month_begin, id_type_defaut, code_centrale]) @@map("Defauts") } model DenominationModule { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) entree_onduleurs EntreeOnduleur[] @@map("DenominationModules") } model DenominationOnduleur { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) onduleurs Onduleur[] @@map("DenominationOnduleurs") } model DonneesFacturation { id Int @id @default(autoincrement()) period_begin DateTime? @db.Date period_end DateTime? @db.Date tarif Decimal? @db.Decimal production Decimal? @db.Decimal consumption Decimal? @db.Decimal index_prod_period_begin Decimal? @db.Decimal index_conso_period_begin Decimal? @db.Decimal quantite_prod_rte Decimal? @db.Decimal prix_unitaire_rte Decimal? @db.Decimal amount_rte Decimal? @db.Decimal quantite_prod_mo Decimal? @db.Decimal prix_unitaire_mo Decimal? @db.Decimal amount_mo Decimal? @db.Decimal quantite_frais_gestion Decimal? @db.Decimal prix_unitaire_frais_gestion Decimal? @db.Decimal amount_frais_gestion Decimal? @db.Decimal quantite_penalite Decimal? @db.Decimal prix_unitaire_penalite Decimal? @db.Decimal amount_frais_penalite Decimal? @db.Decimal numero_facture String? @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) facture Facture? @relation(fields: [numero_facture], references: [numero_facture], onDelete: NoAction) @@unique([period_begin, period_end, numero_facture], map: "donnees_facturations_period_begin_period_end_numero_facture") @@map("DonneesFacturations") } model EntreeOnduleur { id Int @id @default(autoincrement()) emplacement String? @db.VarChar(255) branches Int? modules_per_branch Int? power_per_module Decimal? @db.Decimal orientation Decimal? @db.Decimal inclinaison Decimal? @db.Decimal serial_onduleur String? @db.VarChar(255) id_denomination_module Int? createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) denomination_module DenominationModule? @relation(fields: [id_denomination_module], references: [id], onDelete: Cascade) onduleur Onduleur? @relation(fields: [serial_onduleur], references: [serial], onDelete: NoAction) @@map("EntreeOnduleurs") } model EquipeMp { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrales Centrale[] @@map("EquipeMps") } model Event { id Int @id @default(autoincrement()) siteIdent String? @db.VarChar(255) gatewayIdent String? @db.VarChar(255) msgTimestamp DateTime @db.Timestamptz(6) deviceIdent String? @db.VarChar(255) versionFW String? @db.VarChar(255) register String? @db.VarChar(255) value String? @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) @@map("Events") } model FactureArchivee { id_facture String @id @db.VarChar(255) period_begin DateTime? @db.Date period_end DateTime? @db.Date numero_contrat_achat String? @db.VarChar(255) date_facturation DateTime? @db.Date tarif Decimal? @db.Decimal production Decimal? @db.Decimal createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) contrat_achat ContratAchat? @relation(fields: [numero_contrat_achat], references: [numero], onDelete: NoAction) @@map("FactureArchivees") } model Facture { numero_facture String @id @db.VarChar(255) period_begin DateTime? @db.Date period_end DateTime? @db.Date numero_contrat_achat String? @db.VarChar(255) date_facturation DateTime? @db.Date id_statut_facture Int? createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) data_facturation DonneesFacturation[] statut_facture StatutFacture? @relation(fields: [id_statut_facture], references: [id], onDelete: NoAction) contrat_achat ContratAchat? @relation(fields: [numero_contrat_achat], references: [numero], onDelete: Cascade) @@map("Factures") } model FormeJuridique { id Int @id @default(autoincrement()) acronyme String? @unique @db.VarChar(255) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) producteurs Producteur[] @@map("FormeJuridiques") } model GhiBp { code_centrale Int month String @db.VarChar(255) value Decimal @db.Decimal createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: Cascade) @@id([code_centrale, month]) @@map("GhiBps") } model GhiPrevisionnel { code_centrale Int day DateTime @db.Date value Decimal @db.Decimal createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: NoAction) @@id([code_centrale, day]) @@map("GhiPrevisionnels") } model GhiReel { code_centrale Int day DateTime @db.Date value Decimal @db.Decimal createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: NoAction) @@id([code_centrale, day]) @@map("GhiReels") } model GroupeCentrale { id_groupe Int code_centrale Int createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) Centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: Cascade) Groupe Groupe @relation(fields: [id_groupe], references: [id], onDelete: Cascade) @@id([id_groupe, code_centrale]) @@map("GroupeCentrales") } model Groupe { id Int @id @default(autoincrement()) libelle String @unique @db.VarChar(255) updatedBy String? @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) GroupeCentrales GroupeCentrale[] users User[] @@map("Groupes") } model IssueUnavailabilitie { id Int @id @default(autoincrement()) percent Float start_date DateTime? @db.Timestamptz(6) issue_id Int createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) issue Issue @relation(fields: [issue_id], references: [id], onDelete: Cascade) @@map("IssueUnavailabilities") } model Issue { id Int @id @default(autoincrement()) key_jira String? @unique @db.VarChar(255) id_care Int? @unique unavailability_category String? @db.VarChar(255) code_centrale Int? createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) alertes Alerte[] issue_unavailabilities IssueUnavailabilitie[] centrale Centrale? @relation(fields: [code_centrale], references: [code_centrale], onDelete: Cascade) @@map("Issues") } model Log { id Int @id @default(autoincrement()) id_type_log Int? mail_user String? @db.VarChar(255) content Json? createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) type_log TypeLog? @relation(fields: [id_type_log], references: [id], onDelete: NoAction) user User? @relation(fields: [mail_user], references: [mail], onDelete: NoAction) @@map("Logs") } model Marque { id Int @id @default(autoincrement()) libelle String @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) articles Article[] @@map("Marques") } model ModelFacture { id Int @id @default(autoincrement()) model String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) contrats ContratAchat[] @@map("ModelFactures") } model Onduleur { serial String @id @db.VarChar(255) date_msi DateTime? @db.Timestamptz(6) date_remplacement DateTime? @db.Timestamptz(6) numero Int? id_care Int? @unique code_centrale Int? id_denomination_onduleur Int? createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) entrees EntreeOnduleur[] centrale Centrale? @relation(fields: [code_centrale], references: [code_centrale], onDelete: Cascade) denomination_onduleur DenominationOnduleur? @relation(fields: [id_denomination_onduleur], references: [id], onDelete: Cascade) @@map("Onduleurs") } model Producteur { numero_societe String @id @db.VarChar(255) raison_sociale String @unique @db.VarChar(255) adresse String @db.VarChar(255) code_postal String @db.VarChar(255) commune String @db.VarChar(255) telephone String @db.VarChar(255) mail String @db.VarChar(255) numero_tva String @db.VarChar(255) rcs String @db.VarChar(255) naf String @db.VarChar(255) iban String @db.VarChar(255) capital Int id_forme_juridique Int createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrales Centrale[] contrats_achat ContratAchat[] forme_juridique FormeJuridique @relation(fields: [id_forme_juridique], references: [id], onDelete: Cascade) @@map("Producteurs") } model ProductionBp { code_centrale Int month String @db.VarChar(255) value Decimal @db.Decimal createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: NoAction) @@id([code_centrale, month]) @@map("ProductionBps") } model ProductionCompteur { code_centrale Int month String @db.VarChar(255) cdc_enedis_value Decimal? @db.Decimal enedis_value Decimal? @db.Decimal streem_value Decimal? @db.Decimal manual_value Decimal? @db.Decimal createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: Cascade) @@id([code_centrale, month]) @@map("ProductionCompteurs") } model ProductionCompteurEnedis { code_centrale Int month String @db.VarChar(255) numero_cardi String enedis_value Decimal? @db.Decimal createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: Cascade) cardi Cardi @relation(fields: [numero_cardi], references: [numero], onDelete: Cascade) @@id([code_centrale, month, numero_cardi]) @@map("ProductionCompteurEnedis") } model ProductionOnduleur { code_centrale Int day DateTime @db.Date value Decimal @db.Decimal dispo Int index Decimal @db.Decimal createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: Cascade) @@id([code_centrale, day]) @@map("ProductionOnduleurs") } model RapportProduction { month String @db.VarChar(255) commentaire_recurrent String? commentaire_recurrent_masque String? commentaire String? id_statut_rapport_production Int? code_centrale Int mfiles_id Int? published_at DateTime? @db.Timestamptz(6) size Int? createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: NoAction) statut_rapport_production StatutRapportProduction? @relation(fields: [id_statut_rapport_production], references: [id], onDelete: NoAction) @@id([month, code_centrale]) @@map("RapportProductions") } model Rapport { id Int @id @default(autoincrement()) code_centrale Int? categorie String? @db.VarChar(255) chemin String @unique @db.VarChar(255) date DateTime? @db.Timestamptz(6) nom String? @db.VarChar(255) taille Int? type String? @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrale Centrale? @relation(fields: [code_centrale], references: [code_centrale], onDelete: NoAction) @@map("Rapports") } model Recherche { mail_charge_exploitation String @db.VarChar(255) name String @db.VarChar(255) fields Json? favorite Boolean? @default(false) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) charge_exploitation ChargeExploitation @relation(fields: [mail_charge_exploitation], references: [mail_user], onDelete: Cascade) @@id([mail_charge_exploitation, name]) @@map("Recherches") } model SourceData { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) ContratAchat ContratAchat[] } model StatutAlerte { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) alertes Alerte[] @@map("StatutAlertes") } model StatutFacture { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) factures Facture[] @@map("StatutFactures") } model StatutRapportProduction { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) rapport_productions RapportProduction[] @@map("StatutRapportProductions") } model Superviseur { mail_user String @id @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) user User @relation(fields: [mail_user], references: [mail], onDelete: NoAction) zones Zone[] @@map("Superviseurs") } model TarifFacturation { id Int @id @default(autoincrement()) start_date DateTime? @db.Timestamptz(6) value Decimal @db.Decimal code_centrale Int? createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrale Centrale? @relation(fields: [code_centrale], references: [code_centrale], onDelete: Cascade) @@map("TarifFacturations") } model TechnicienMaintenance { mail_user String @id @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) user User @relation(fields: [mail_user], references: [mail], onDelete: NoAction) ZoneTechnicienMaintenances ZoneTechnicienMaintenance[] @@map("TechnicienMaintenances") } model TechnoCentrale { id_techno Int code_centrale Int createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) Centrales Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: Cascade) Techno Techno @relation(fields: [id_techno], references: [id], onDelete: Cascade) @@id([id_techno, code_centrale]) @@map("TechnoCentrales") } model Techno { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) deletedAt DateTime? @db.Timestamptz(6) TechnoCentrales TechnoCentrale[] @@map("Technos") } model TemperatureReelle { code_centrale Int day DateTime @db.Date value Decimal @db.Decimal createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrale Centrale @relation(fields: [code_centrale], references: [code_centrale], onDelete: Cascade) @@id([code_centrale, day]) @@map("TemperatureReelles") } model TypeAlerte { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) alertes Alerte[] configuration_typealerte_centrale ConfigurationTypeAlerteCentrale[] @@map("TypeAlertes") } model TypeArret { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) arrets Arret[] @@map("TypeArrets") } model TypeArticle { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) articles Article[] @@map("TypeArticles") } model TypeCardi { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) cardis Cardi[] @@map("TypeCardis") } model TypeContratAchat { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) deletedAt DateTime? @db.Timestamptz(6) contrats_achat ContratAchat[] @@map("TypeContratAchats") } model TypeContrat { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) deletedAt DateTime? @db.Timestamptz(6) ContratTypeContrats ContratTypeContrat[] @@map("TypeContrats") } model TypeDatalogger { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrales Centrale[] @@map("TypeDataloggers") } model TypeDefaut { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) defauts Defaut[] @@map("TypeDefauts") } model TypeLog { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) logs Log[] @@map("TypeLogs") } model TypeModem { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) centrales Centrale[] @@map("TypeModems") } model TypePanneau { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) CentraleTypePanneaus CentraleTypePanneau[] @@map("TypePanneaus") } model TypeStructure { id Int @id @default(autoincrement()) libelle String? @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) CentraleTypeStructures CentraleTypeStructure[] @@map("TypeStructures") } model User { mail String @id @db.VarChar(255) nom String? @db.VarChar(255) prenom String? @db.VarChar(255) telephone String? @db.VarChar(255) id_group Int? createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) Automaticien Automaticien? ChargeExploitation ChargeExploitation? ChefProjet ChefProjet? Client Client? Logs Log[] Superviseur Superviseur? TechnicienMaintenance TechnicienMaintenance? group Groupe? @relation(fields: [id_group], references: [id], onDelete: Cascade) reportedWOs WorkOrder[] @relation("reporter") fencingWOs WorkOrder[] @relation("fencingIntervener") intervenedWOs WorkOrderIntervener[] technicianPilotsWOs WorkOrderTechnicianPilot[] @@map("Users") } model WorkOrderIntervener { user_mail String work_order_id Int User User @relation(fields: [user_mail], references: [mail]) WorkOrder WorkOrder @relation(fields: [work_order_id], references: [id]) @@id([user_mail, work_order_id]) @@map("WorkOrderIntervener") } model WorkOrderTechnicianPilot { user_mail String work_order_id Int User User @relation(fields: [user_mail], references: [mail]) WorkOrder WorkOrder @relation(fields: [work_order_id], references: [id]) @@id([user_mail, work_order_id]) @@map("WorkOrderTechnicianPilot") } model WorkOrder { id Int @id @default(autoincrement()) identification_information_comments String? incident_description String? criticity Int creation_date String work_order_number Int @unique dead_line String? intervention_frequency Int? close_with_active_criticality_4_WO Boolean? ubs_intervener_comment String? external_intervener_comment String? planned_intervention_start_date String planned_intervention_duration Int? planned_intervention_end_date String work_time_since_last_restart Int? intervention_close_date String? intervention_close_comment String? power_plant_id Int @map("power_plant_id") power_plant Centrale @relation(fields: [power_plant_id], references: [code_centrale]) work_order_type_id Int @map("work_order_type_id") work_order_type WorkOrderType @relation(fields: [work_order_type_id], references: [id]) reporter_email String? reporter User? @relation("reporter" ,fields: [reporter_email], references: [mail]) fencing_intervener_mail String? fencing_intervener User? @relation("fencingIntervener", fields: [fencing_intervener_mail], references: [mail]) technician_pilots WorkOrderTechnicianPilot[] interveners WorkOrderIntervener[] } model WorkOrderType { id Int @id @default(autoincrement()) type String workOrders WorkOrder[] } model ZoneTechnicienMaintenance { acronyme String @db.VarChar(255) mail_user String @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) Zone Zone @relation(fields: [acronyme], references: [acronyme], onDelete: Cascade) TechnicienMaintenance TechnicienMaintenance @relation(fields: [mail_user], references: [mail_user], onDelete: Cascade) @@id([acronyme, mail_user]) @@map("ZoneTechnicienMaintenances") } model Zone { acronyme String @id @db.VarChar(255) nom String? @db.VarChar(255) mail_superviseur String? @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) deletedAt DateTime? @db.Timestamptz(6) centrales Centrale[] ZoneTechnicienMaintenances ZoneTechnicienMaintenance[] superviseur Superviseur? @relation(fields: [mail_superviseur], references: [mail_user], onDelete: Cascade) @@map("Zones") } model EquipmentStatus { id Int @id @default(autoincrement()) libelle String @unique @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) Equipments Equipment[] @@map("EquipmentStatus") } model Equipment { id Int @id @default(autoincrement()) id_equipmentStat Int createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6) EquipmentStatus EquipmentStatus @relation(fields: [id_equipmentStat], references: [id], onDelete: NoAction) @@map("Equipments") } view ProductionCompteurView { code_centrale Int month String @db.VarChar(255) cdc_enedis_value Decimal? @db.Decimal enedis_value Decimal? @db.Decimal streem_value Decimal? @db.Decimal manual_value Decimal? @db.Decimal @@unique([code_centrale, month]) } view ConsoCompteurView { code_centrale Int month String @db.VarChar(255) enedis_value Decimal? @db.Decimal streem_value Decimal? @db.Decimal @@unique([code_centrale, month]) }