Skip to content

Naming of relation #159

@Tigrov

Description

@Tigrov

$relations is keyed by $relation->getName(), so multiple foreign keys that resolve to the same related model name (e.g., created_by and updated_by both referencing user) will silently overwrite each other and only one relation will be generated. Consider making relation names unique (e.g., include FK column(s) or constraint name in the generated relation name) or explicitly detecting collisions and throwing a clear exception so the user can resolve it.

Originally posted by @Tigrov in #157 (comment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions