No documentation of foreign keys (references) on Seeds
Right now i'm very frustrated about the seeds, i can't create a seed who works with foreign keys, i read all the issues here and nothing works or help me to guide me, this is my file:
module.exports = {
up: function (queryInterface, Sequelize) {
return queryInterface.bulkInsert('Projects', [{
idUser: 1,
name: 'Test text',
description: 'Text test demonstration',
enabled: true,
properties: JSON.stringify({"api_url": "api_text", "account_type": "basic"}),
createdAt: new Date,
updatedAt: new Date
}], {});
},
};
Where my idUser is my foreign key. And yes, i have data created for that user, and yes, that id already exist in Users table.
I see that Sequelize value has .Associations, but no idea how to use it in this situation, any advice?.
I'm using:
"sequelize": "^3.29.0",
"sequelize-cli": "^2.5.1"
And the error i got is:
Seed file failed with error: column "properties" of relation "Projects" does not exist.
Thanks for your help.
This has nothing to do with idUser or associations. The error message pretty clearly tells you, that the properties column does not exist on the Projects table.
Please open a new issue with a SSCCE if you still have issues