From 4ccf138744b026e5ea0adf75928f30f3731ce0c1 Mon Sep 17 00:00:00 2001 From: Vantz Stockwell Date: Sat, 14 Mar 2026 01:48:19 -0400 Subject: [PATCH] fix: seed script checks for any existing user, not just admin@wraith.local Previously the seed only checked for admin@wraith.local by email, so it would create a duplicate if the admin had changed their email. Now skips seeding entirely if any user exists. Co-Authored-By: Claude Opus 4.6 --- backend/seed.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/seed.js b/backend/seed.js index 3593247..041aee8 100644 --- a/backend/seed.js +++ b/backend/seed.js @@ -4,9 +4,9 @@ const bcrypt = require('bcrypt'); const prisma = new PrismaClient(); async function main() { - const existing = await prisma.user.findUnique({ where: { email: 'admin@wraith.local' } }); - if (existing) { - console.log('Seed: admin user already exists, skipping'); + const userCount = await prisma.user.count(); + if (userCount > 0) { + console.log('Seed: users already exist, skipping'); return; } const hash = await bcrypt.hash('wraith', 10);