Skip to content
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 - DB Seeding Issue Solution (checkInsertTargets) #878

Open
berkay-yuksel opened this issue Oct 5, 2024 · 0 comments
Open

Chapter 6 - DB Seeding Issue Solution (checkInsertTargets) #878

berkay-yuksel opened this issue Oct 5, 2024 · 0 comments

Comments

@berkay-yuksel
Copy link

error {8} length:122 name:"error" severity:"ERROR" code:"42703" position:"33" file:"parse_target.c" line:"1075" routine:"checkInsertTargets"

The reason I was encountering the error above was that the 'users' table already existed in my database. If any of the tables from the example code { invoices, customers, revenue, users } already exist, you can resolve the issue by dropping the relevant table using a query like DROP TABLE users in the Data -> Query section on Vercel

Additionally, you can add error.message to the Response.json to provide a improved log of the error:

catch (error) {
  console.error('Seeding error:', error);
  await client.sql`ROLLBACK`;
  return Response.json({ error: error.message }, { status: 500 });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant