File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -443,8 +443,13 @@ protected function prepareIndexes(array $indexes):array
443443 }
444444 }
445445 foreach ($ props as $ prop ) {
446+ // for more info see test tests/specs/fk_col_name/fk_col_name.yaml
447+ // File: ForeignKeyColumnNameTest::testIndexForColumnWithCustomName
448+ // first check direct column names
446449 if (!isset ($ this ->attributes [$ prop ])) {
450+ // then check x-fk-column-name
447451 if (!in_array ($ prop , array_keys ($ xFkColumnNames ))) {
452+ // then check relations/reference e.g. `user`/`user_id`
448453 $ refPropName = (substr ($ prop , -3 ) === '_id ' ) ? rtrim ($ prop , '_id ' ) : null ;
449454 if ($ refPropName && !isset ($ this ->attributes [$ refPropName ])) {
450455 throw new InvalidDefinitionException ('Invalid index definition - property ' . $ prop
You can’t perform that action at this time.
0 commit comments