Sequelize relation with WHERE IN (“ARRAY”)
问题 Is it possible to define a relationships in sequelize where multiple foreign keys are stored as an array in one field. Basically a belongsToMany but instead of an relation table all ids are stored comma separated in one field. Query would be with WHERE IN('1,5,7') . 回答1: You can do it, but definitely without foreign key constraints - there is no possibility of storing array of foreign keys. You can however create a column which will be an array of integers representing IDs of associated table