Closed aekst closed 4 years ago
Not yet, and there are only "options" generated for foreign keys. 😅
Sorry for my ambiguity. What I wanna say is that I didn't find a proper way to utilize those indexes. I've skimmed through
https://sequelize.org/v5/class/lib/model.js~Model.html#static-method-init https://sequelize.org/v5/manual/models-definition.html#indexes https://sequelize.org/v5/class/lib/query-interface.js~QueryInterface.html#instance-method-addIndex https://sequelize.org/v5/manual/models-usage.html#eager-loading
but got no answer.
Are they sufficient to be used in a relation way?
I think what you mean is Association, and I'm sorry to tell that the answer is No
.
sequelize-automate
can't create associations between models. The indexes are only descriptions of tables.
You could create association based on those models generated by sequelize-automate
if you want to use it.
Can I generate associations like "HasOne/ BelongsTo" too? It seems that there are only "options" generated for foreign keys for model definition. So compound queries still need to be done manually.