baseline prisma bdd at first setup (#1124)

* Baseline database (migrations) in setup

Co-authored-by: Thomas Kaul <4159106+dtslvr@users.noreply.github.com>
pull/1127/head
Le_Bleu 2 years ago committed by GitHub
parent 51431a7fb2
commit 7ec9170c0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -17,6 +17,7 @@
"build:dev": "nx run api:build && nx run client:build && yarn replace-placeholders-in-build",
"build:storybook": "nx run ui:build-storybook",
"clean": "rimraf dist",
"database:baseline": "sh ./prisma/baseline.sh",
"database:format-schema": "prisma format",
"database:generate-typings": "prisma generate",
"database:gui": "prisma studio",
@ -24,7 +25,7 @@
"database:migrate": "prisma migrate deploy",
"database:push": "prisma db push",
"database:seed": "prisma db seed",
"database:setup": "yarn database:push && yarn database:seed",
"database:setup": "yarn database:push && yarn database:seed && yarn database:baseline",
"dep-graph": "nx dep-graph",
"e2e": "ng e2e",
"format": "nx format:write",

@ -0,0 +1,8 @@
#!/bin/sh
# List all migration scripts based on the directory name and mark the migration as "applied"
for directory in ./prisma/migrations/*/; do
migration=$(echo "$directory" | sed 's/.\/prisma\/migrations\///' | sed 's/\///')
yarn prisma migrate resolve --applied $migration
done
Loading…
Cancel
Save