bake
bake copied to clipboard
Table with *_id column that isn't a foreign key doesn't generate validation
When baking a model for a table with a column that "looks" like a foreign key such as external_id
but has no target table, no validation is generated for the column. Instead an association to a non-existent model is generated.
After removing the invalid association, the user might not notice the validation is missing.
@othercorey Hi, I was trying to reproduce this bug using a table with a field theme_id
and no themes table but the validation was generated correctly:
$validator
->nonNegativeInteger('theme_id')
->requirePresence('theme_id', 'create')
->notEmptyString('theme_id');
Could you please provide more details about how to reproduce this bug? Please include Bake version and a DB schema if possible.
This issue is stale because it has been open for 120 days with no activity. Remove the stale
label or comment or this will be closed in 15 days
Is this still valid and reproducable?