example-invoice
example-invoice copied to clipboard
Encountered error when seeding database for invoice example
Got the following error when attempting to seed the database. I checked the code and it seems that the context object is not defined or something like. I am very new react and JS in general but I am will participate in getting this resolved.
/Users/xxxx/project/JS/example-invoice/node_modules/.bin/rw db seed Seeding your database... [started] PrismaClientValidationError: Invalid
prisma.invoice.create()` invocation in
/Users/aaliu/project/JS/example-invoice/api/prisma/seeds.js:36:38
{ data: { invoiceNumber: '2020001', date: '03/12/2020', body: '{"title":"I N V O I C E","companyName":"Example Inc.","companyInfo":"example.com\[email protected]","recipient":"Michael Scott Paper Company Inc.\n1725 Slough Avenue\nScranton, Pennsylvania","information":[[{"value":"Invoice #"},{"value":"044"}],[{"value":"Date"},{"value":"7/25/2020"}]],"lineItems":[[{"value":"Description"},{"value":"Quantity"},{"value":"Price"}],[{"value":"Wheel of cheese"},{"value":1},{"value":500}],[{"value":"Jar of sausages"},{"value":2},{"value":2.99}],[{"value":"Tin of waffles"},{"value":2},{"value":3.01}]],"summary":[[{"value":"Subtotal"},null,"0.0"],[{"value":"Tax Rate"},{"value":0},"0.0"],[{"value":"Total"},{"value":"$"},"0.0"]],"notesA":"","notesB":"Invoice by billable.me"}',
- user: {
-
create?: UserCreateWithoutInvoicesInput,
-
connect?: UserWhereUniqueInput
- }, ? createdAt?: DateTime, ? updatedAt?: DateTime } }
Argument user for data.user is missing.
` Let me if you have questions.
resuming from https://github.com/redwoodjs/example-invoice/issues/43 cc @dale-french
The data models have changed so running yarn rw db seed
fails (needs a user).
@peterp Question: are you even using seed.js
anymore? I see that the Invoices have default content now, but it's coming from code and not the DB.