You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just an idea: as for now, we importing FKs as simple references for our models - we did not generate any associations.
But many FKs actually are 1:M or 1:1 relations (maybe some are M:M via some table). Converting references int associations is 100% manual process as for now.
This can be changed in some way.
Sequelize-auto (SqA) did not know about proper schema and associations between models, but whole process can be iterative with involving user:
SqA makes initial import of some tables and generate JSON file with list of references based of FKs (optionally, all FKs are converted to references in models); each reference in JSON file marked as "simple reference";
user makes some changes in JSON to modify list of references and specify proper type of relation as 1:M, 1:1 relations for some or all discovered references (convert "simple reference" to "specified reference");
SqA makes second pass using same JSON file, for specified references SqA will generate proper model associations (hasOne, hasMany, etc), for "simple references" or newly discovered references (maybe user adds some more tables to import, or maybe user did not process whole file) that references optionally converted to references in model (like today);
Not sure how we should process M:M relations, but 1:1 and 1:M looks not so complicated.
The text was updated successfully, but these errors were encountered:
Just an idea: as for now, we importing FKs as simple references for our models - we did not generate any associations.
But many FKs actually are 1:M or 1:1 relations (maybe some are M:M via some table). Converting references int associations is 100% manual process as for now.
This can be changed in some way.
Sequelize-auto (SqA) did not know about proper schema and associations between models, but whole process can be iterative with involving user:
Not sure how we should process M:M relations, but 1:1 and 1:M looks not so complicated.
The text was updated successfully, but these errors were encountered: