RFC: Do not generate associations for _id
fields if no Table object or database table present
#839
Labels
_id
fields if no Table object or database table present
#839
Description
When baking a model, if you database table has a field with
_id
suffix it generates a belongsTo association. It is usually useful but sometimes it is not an actual association.i.e A
users
table with anexternal_id
to store the user id in another app/service.Currently Bake would generate a belongsTo association with
Externals
as alias, even if ExternalsTable does not exist andexternals
table does not exist onto database.I would propose to only generate the association if any of the above conditions is met.
I have a partial solution already but I would like to know your thoughts.
The text was updated successfully, but these errors were encountered: