next-learn
next-learn copied to clipboard
re-running seed script inserts duplicate invoices
Each time npm run seed is executed, an extra 15 rows are inserted into the invoices table.
This is because:
- no member of the
invoicesarray exported from the placeholder include invoices[n].id; and - The
idfield is not included in the sql insert statement in the seed.ts script.
I have created https://github.com/vercel/next-learn/pull/537 to address these issues.