Skip to content

Commit

Permalink
seed
Browse files Browse the repository at this point in the history
  • Loading branch information
revmischa committed Jul 2, 2024
1 parent 283024d commit 00528c9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"migrate:dev": "pnpm run format && prisma migrate dev",
"migrate:test": "pnpm init:db:test && dotenv -e .env.vitest -- prisma migrate dev --skip-seed --skip-generate",
"init:db:test": "[ -n \"$CI\" ] || (docker-compose exec -T database dropdb -U postgres --if-exists tests && docker-compose exec -T database createdb -U postgres tests)",
"db:seed": "prisma db seed",
"db:seed:clean": "CLEAN_SEED=true prisma db seed",
"seed": "prisma db seed",
"seed:clean": "CLEAN_SEED=true prisma db seed",
"generate": "prisma generate"
},
"prisma": {
Expand Down
3 changes: 1 addition & 2 deletions backend/seed-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ set -euxo pipefail
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
cd "$SCRIPT_DIR/.."

pnpm exec sst load-config -- \
pnpm tsx backend/src/db/seed/seedScript.ts
pnpm tsx backend/src/db/seed/seedScript.ts
9 changes: 5 additions & 4 deletions backend/src/db/seed/seedScript.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { seedFakerSampleData } from '@backend/db/seed/fakeSampleData';
import { seedFakerSampleData } from '@backend/db/seed/fakeSampleData'

const { prisma } = await import('@backend/db/clientSync');
const { prisma } = await import('@backend/db/clientSync')

await seedFakerSampleData();
await prisma.$disconnect();
await seedFakerSampleData()
await prisma.$disconnect()
process.exit(0)

0 comments on commit 00528c9

Please sign in to comment.