Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Sépare les migrations prisma de la webapp et de l'ELT
Car les deux écrivent dans des schémas séparés, et que la feature "multiSchema" de prisma est encore en preview et ne supporte pas les migration (on a eu des erreurs PG 42P07 lors des prisma migrate reset) - prisma/prisma#15077 (comment)
- Loading branch information
1 parent
a5cf70c
commit 004c4b0
Showing
9 changed files
with
79 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "postgresql" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// This is your Prisma schema file, | ||
// learn more about it in the docs: https://pris.ly/d/prisma-schema | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = env("ELT_DATABASE_URL") | ||
} | ||
|
||
model metadata_chantier { | ||
chantier_id String @id | ||
ch_code String? | ||
ch_descr String? | ||
ch_nom String | ||
ch_ppg String | ||
ch_perseverant String? | ||
porteur_shorts_noDAC String | ||
porteur_ids_noDAC String | ||
porteur_shorts_DAC String? | ||
porteur_ids_DAC String? | ||
ch_per String | ||
} | ||
|
||
model metadata_perimetre { | ||
perimetre_id String @id | ||
per_nom String | ||
per_short String? | ||
per_picto String? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { PrismaClient } from '@prisma/client'; | ||
|
||
const prisma = new PrismaClient(); | ||
|
||
async function main() { | ||
} | ||
main() | ||
.then(async () => { | ||
await prisma.$disconnect(); | ||
}) | ||
.catch(async (error) => { | ||
console.error(error); | ||
await prisma.$disconnect(); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- CreateTable | ||
CREATE TABLE "chantier" ( | ||
"id" TEXT NOT NULL, | ||
"nom" TEXT NOT NULL, | ||
"id_perimetre" TEXT NOT NULL, | ||
|
||
CONSTRAINT "chantier_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "perimetre" ( | ||
"id" TEXT NOT NULL, | ||
"nom" TEXT NOT NULL, | ||
|
||
CONSTRAINT "perimetre_pkey" PRIMARY KEY ("id") | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.