How to define compound bond in Sequelize?

//1: 
{
 name: "A",
 age: 10
}
//2:
[{
 id:1,
 name:"A", // 1name
 book:"xxx"
},
{
 id:2,
 name:"A",
 book:"xxx"
}]

name A book are all stored in Table 2. How to deal with a table structure like this?


I don't know what you want to ask and what to deal with.
establish a relationship between two tables?

const Script = require('../model/Script'), // Script--model
  Project = require('../model/Project'); // Project--model

// project & scriptmodel
Script.belongsTo(Project);
Project.hasMany(Script);
Menu