Open
Description
in placeholder-data.ts 👍
{
id: '3958dc9e-712f-4377-85e9-fec4b6a6442a',
name: 'Delba de Oliveira',
email: 'delba@oliveira.com',
image_url: '/customers/delba-de-oliveira.png',
},
{
id: '3958dc9e-742f-4377-85e9-fec4b6a6442a',
name: 'Lee Robinson',
email: 'lee@robinson.com',
image_url: '/customers/lee-robinson.png',
},
because id must be unique, the db seeding fails, with the error (I am on Neon) of:
{
"error": {
"name": "PostgresError",
"severity_local": "ERROR",
"severity": "ERROR",
"code": "23505",
"detail": "Key (extname)=(uuid-ossp) already exists.",
"schema_name": "pg_catalog",
"table_name": "pg_extension",
"constraint_name": "pg_extension_name_index",
"file": "nbtinsert.c",
"line": "664",
"routine": "_bt_check_unique"
}
}
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]The lib file to seed the db contains 2x customers with duplicate id[/-][+]Chapter 6: The lib file to seed the db contains duplicate ID values[/+]DavidCWHung commentedon Feb 24, 2025
id: '3958dc9e-712f-4377-85e9-fec4b6a6442a', and id: '3958dc9e-742f-4377-85e9-fec4b6a6442a', seems different tho?
leerob commentedon Feb 25, 2025
This might be because you're already ran the seeding process and the data is in the DB. Could you check?
Razr6 commentedon Feb 25, 2025
Sorry, I'm a newb and am just struggling my way through the tutorial, for the fourth time. I can't now tell if I had seeded it once or twice, when this happened.
When I first got the error, I looked about, looked in the db files and as far as I can I remember, the other tables had all seeded ok but the customer table was simply not there. And then I thought I had traced the problem back to the data in the placeholder-data.ts file. But as DavidCWHung points out the IDs are actually different - by just 1x character, buried in the middle of a 36 chr string (?).
Anyway. So I guess I was wrong. Looks like I am probably wasting your time here.
w0244079 commentedon Feb 26, 2025
@leerob I experienced the same issue today when doing the tutorial...I've sent along a PR (#1013) for review which when applied fixed the problem for me....hope it helps.
chrissygonzalez commentedon Mar 3, 2025
I also ran into problems seeding (somehow missing the invoice in the chapter 6 query, and fewer than expected customers). @w0244079 Your fix worked for me, thank you. I can move on to chapter 7 now 🥇
kRadius commentedon Jun 16, 2025
change placeholder-data 'id' to other name.
for example:
then fix 'seed/route.ts' error