cms icon indicating copy to clipboard operation
cms copied to clipboard

fix: resolve database seeding issue

Open tanmay4l opened this issue 1 year ago • 1 comments

This PR fixes the issue with the database seeding process, which was failing due to a unique constraint violation on the id field of the Content model.

Changes:

  • Updated the seedContent function to create the folder first, and then generate content items with dynamic IDs and the correct parentId referencing the folder's ID.

  • Removed the hard-coded id values from the content items, as Prisma will now generate unique IDs automatically.

before : Screenshot 2567-05-13 at 11 21 10 AM

after: Screenshot 2567-05-13 at 11 21 28 AM

tanmay4l avatar May 13 '24 05:05 tanmay4l

@hkirat can u check this >?

tanmay4l avatar May 13 '24 05:05 tanmay4l