Skip to content

chore: force wipe database before seeding - #19

Merged
peucastro merged 2 commits into
mainfrom
pedrolunet/update-seed
Oct 2, 2026
Merged

peucastro merged 2 commits into
mainfrom
pedrolunet/update-seed

Conversation

@PedroLunet

Copy link
Copy Markdown
Member

Description

This PR makes the Prisma seed script strictly idempotent by forcefully wiping all existing data from the database using Prisma 8's raw execution lane (db.runtime().execute) before inserting the mock data.

This means pnpm run seed can now be run repeatedly to completely reset the local database without hitting unique constraint errors.

Changes

  • src/prisma/seed.ts: Replaced simple .create() flow with explicit raw DELETE FROM statements.
  • .env.example: Updated the default connection string from localhost to 127.0.0.1 to prevent IPv6/IPv4 binding issues (EPERM) on macOS when using the pure-JS pg driver.
  • Cleaned up unrelated local frontend files.

@peucastro peucastro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@peucastro
peucastro merged commit 4265514 into main Oct 2, 2026
2 checks passed
@peucastro
peucastro deleted the pedrolunet/update-seed branch October 2, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants