next-learn
next-learn copied to clipboard
Add invoice.id to invoice placeholder data and seed script
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 is attempting to deploy a commit to the Vercel Team on Vercel.
A member of the Team first needs to authorize it.
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 |
Thank you @murfett-au for opening the PR and clearly explaining the issue 🙏🏼
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.