-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Chapter 6: The lib file to seed the db contains duplicate ID values #1005
Comments
id: '3958dc9e-712f-4377-85e9-fec4b6a6442a', and id: '3958dc9e-742f-4377-85e9-fec4b6a6442a', seems different tho? |
This might be because you're already ran the seeding process and the data is in the DB. Could you check? |
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. |
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 🥇 |
in placeholder-data.ts 👍
{
id: '3958dc9e-712f-4377-85e9-fec4b6a6442a',
name: 'Delba de Oliveira',
email: '[email protected]',
image_url: '/customers/delba-de-oliveira.png',
},
{
id: '3958dc9e-742f-4377-85e9-fec4b6a6442a',
name: 'Lee Robinson',
email: '[email protected]',
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"
}
}
The text was updated successfully, but these errors were encountered: