Open cd-slash opened 4 weeks ago
I'd have to dive down into core to see what they assume the name to be. But I would imagine it's singular, snake model name - which is what3_words
. I don't see a bug here as the manual column name is at the users discretion. Unless the model code generated didn't set this as the foreign key in the relationship.
Issue:
When creating a model with a specified column name for a relationship, a second column with a slightly different name is created if the related model name contains a number. For example:
results in the following migration being created:
Note the two different columns,
what3_words_id
derived from the relationship, andwhat_3_words_id
as specified manually in the blueprint.I have not been able to determine what the proper convention should be for model names that contain numbers, but have styled this model name to match how the company itself styles their location IDs (see What3Words).
I can of course work around this by spelling out the number (i.e.
WhatThreeWords
) but it seems to me like a number in the middle of a model name should be treated as a word boundary rather than a continuation of the prior word, while consecutive numbers should be considered a single word for the purposes of column naming. Open to alternative views.draft.yaml: shown above