You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The seed data needs to be updated to remove the IDs from Donations and Donors. However, the seeded Donation records still should have a donorId that corresponds to a Donor primary key. So
Donors need to be inserted first;
We need some way to get the list of Donor IDs and randomly (?) assign them to the Donations to be seeded.
In the interim, the DB should be reset and the seed script not used. The /donations/upload endpoint can be used to insert data.
The text was updated successfully, but these errors were encountered:
Observed
Creating a Donation record in the database via Sequelize fails with the following error:
Cause
Turns out this only happens when there is already data in the DB that was put there via the seed script (
npm run db:seed
). This comment suggests that including the primary key attribute in the seed data is unadvisable.Solution
The seed data needs to be updated to remove the IDs from Donations and Donors. However, the seeded Donation records still should have a
donorId
that corresponds to a Donor primary key. SoIn the interim, the DB should be reset and the seed script not used. The
/donations/upload
endpoint can be used to insert data.The text was updated successfully, but these errors were encountered: