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);
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9f743-1a5e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9f743-1a5e.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?