-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pnpm db:seed is giving me a duplicate key value error of users_email_unique. #66
Comments
Have you already ran the script? You could use |
ill try db studio |
I just checked and theres one user of [email protected] email. so I don't see why there's an issue with it. i am afraid to delete it because I want to use that user for testing in general. |
is it possible theres a cookies related issues with this? can I check my database by the terminal to get more accurate info? any help would be great |
const postgres = require('postgres'); // Ensure this is your Postgres library const sql = postgres(process.env.DATABASE_URL); async function seedUsers() {
} catch (error) { seedUsers(); |
pnpm db:seed is giving me a duplicate key value error of users_email_unique. Any suggestions on what to change in the functions?
Seed process failed: PostgresError: duplicate key value violates unique constraint "users_email_unique" at ErrorResponse (/Users/thomasjackson/Desktop/venginez-templates/next-saas-starter/node_modules/.pnpm/[email protected]/node_modules/postgres/cjs/src/connection.js:788:26) at handle (/Users/thomasjackson/Desktop/venginez-templates/next-saas-starter/node_modules/.pnpm/[email protected]/node_modules/postgres/cjs/src/connection.js:474:6) at TLSSocket.data (/Users/thomasjackson/Desktop/venginez-templates/next-saas-starter/node_modules/.pnpm/[email protected]/node_modules/postgres/cjs/src/connection.js:315:9) at TLSSocket.emit (node:events:518:28) at addChunk (node:internal/streams/readable:559:12) at readableAddChunkPushByteMode (node:internal/streams/readable:510:3) at Readable.push (node:internal/streams/readable:390:5) at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) { severity_local: 'ERROR', severity: 'ERROR', code: '23505', detail: 'Key (email)=([email protected]) already exists.', schema_name: 'public', table_name: 'users', constraint_name: 'users_email_unique', file: 'nbtinsert.c', line: '666', routine: '_bt_check_unique'
The text was updated successfully, but these errors were encountered: