So basically using sequelize I created a user model, a product model, and a wishlist model. The wishlist needs to be seeded but I hypothetically want a user to be able to insert more than 1 item into a row. So if I have a column titled product_id I want to be able to put multiple products into that column. Here's the seed file for reference:
const { Wishlist } = require('../models');
const wishlistData = [
{
user_id: 1,
bike_id: 4,
part_id: 1
}
];
const seedwishlist = () => Wishlist.bulkCreate(wishlistData);
module.exports = seedwishlist;
I thought that for the part_id column I can maybe have an array-like
part_id: [1,2,3]
But it gives me an error that it truncates and I can't seed the file.
Any suggestions on solving this problem?