ujusum:3-codage:1-repository:1-pas-a-pas
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| ujusum:3-codage:1-repository:1-pas-a-pas [2026/06/06 20:17] – créée 91.170.108.99 | ujusum:3-codage:1-repository:1-pas-a-pas [2026/06/07 02:17] (Version actuelle) – [Modifier schema.prisma] 91.170.108.99 | ||
|---|---|---|---|
| Ligne 432: | Ligne 432: | ||
| } </ | } </ | ||
| + | --- | ||
| + | En version prisma 7, il faut supprimer la ligne url dans le fichier du schema | ||
| --- | --- | ||
| + | |||
| + | <code prisma> | ||
| + | datasource db { | ||
| + | provider = " | ||
| + | } | ||
| + | |||
| + | generator client { | ||
| + | provider = " | ||
| + | } | ||
| + | |||
| + | model User { | ||
| + | |||
| + | id String @id @default(uuid()) | ||
| + | |||
| + | email | ||
| + | |||
| + | createdAt DateTime @default(now()) | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | --- | ||
| + | et adapter le fichier de prisma.config.ts | ||
| + | --- | ||
| + | < | ||
| + | import path from ' | ||
| + | import { defineConfig } from ' | ||
| + | import { PrismaPg } from ' | ||
| + | |||
| + | export default defineConfig({ | ||
| + | earlyAccess: | ||
| + | schema: path.join(' | ||
| + | migrate: { | ||
| + | adapter() { | ||
| + | return new PrismaPg({ connectionString: | ||
| + | }, | ||
| + | url: process.env.DATABASE_URL!, | ||
| + | }, | ||
| + | }) | ||
| + | </ | ||
| ===== Générer migration ===== | ===== Générer migration ===== | ||
ujusum/3-codage/1-repository/1-pas-a-pas.1780769863.txt.gz · Dernière modification : 2026/06/06 20:17 de 91.170.108.99