Je crois que vous pouvez faire :
db.Page.findAll({
include: [{
model: db.Gallery
include: [{
model: db.Artwork
}]
}],
order: [
// sort by the 'order' column in Gallery model, in descending order.
[ db.Gallery, 'order', 'DESC' ],
// then sort by the 'order' column in the nested Artwork model in a descending order.
// you need to specify the nested model's parent first.
// in this case, the parent model is Gallery, and the nested model is Artwork
[ db.Gallery, db.ArtWork, 'order', 'DESC' ]
]
})
Il existe également un tas de façons différentes ou de choses que vous pouvez faire lors de la commande. En savoir plus ici :https://sequelize.org/master/manual/model-querying-basics.html#ordering-and-grouping