next-learn icon indicating copy to clipboard operation
next-learn copied to clipboard

Add invoice.id to invoice placeholder data and seed script

Open murfett-au opened this issue 1 year ago • 3 comments

The two seed scripts (both final-example and starter-example) both include ON CONFLICT (id) DO NOTHING; in their SQL, but it is not effective. With no 'id' property on the invoices in the placeholder-data, a new, unique id is generated for each invoice on each run of seed, producing duplicate rows (with distinct ids). By adding an id for each invoice in the placeholder data, this PR ensures that duplicates rows are not inserted on each second and subsequent execution of the seed script.

I have created https://github.com/vercel/next-learn/issues/538 to address these issues.

murfett-au avatar Jan 03 '24 02:01 murfett-au

@murfett-au is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Jan 03 '24 02:01 vercel[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-learn-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2024 3:59pm
next-learn-starter ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2024 3:59pm
next-seo-starter ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 8, 2024 3:59pm

vercel[bot] avatar Jan 03 '24 02:01 vercel[bot]

Thank you @murfett-au for opening the PR and clearly explaining the issue 🙏🏼

delbaoliveira avatar Jan 08 '24 15:01 delbaoliveira

Thank you for the suggestion, however, we are going to recommend clearing the data out of the database (e.g. dropping the tables) and re-running the script.

leerob avatar Jun 23 '24 22:06 leerob