Skip to content

Commit

Permalink
Fix foreign key constraint violation in seed script (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
portdeveloper authored Aug 5, 2024
1 parent c5c3ae5 commit 454f131
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/nextjs/services/database/seed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ async function seed() {
await client.connect();
const db = drizzle(client, { schema });

await db.delete(submissions).execute();
await db.delete(builders).execute();

db.insert(builders)
.values([
{ id: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", role: "admin" },
{ id: "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC", role: "user" },
])
.execute();

await db.delete(submissions).execute();
await db
.insert(submissions)
.values([
Expand Down

0 comments on commit 454f131

Please sign in to comment.