db
db copied to clipboard
`getForeignKeys()` - inconsistency of array keys
SQLite:
[['auth_item', 'child' => 'name'], ['auth_item', 'parent' => 'name']];
MySQL:
['auth_item_child_ibfk_1' => ['auth_item', 'child' => 'name'], 'auth_item_child_ibfk_2' => ['auth_item', 'parent' => 'name']];
Do you mean that SQLite does not return FK names?
I mean integer and string keys difference. Maybe add docs for now.
Foreign key in MySQL supports index name, and in SQLite don't supports, so in SQLite used integer ID (seems, it's just number in order) as name.
I think improve phpdoc and make more specified psalm type for TableSchemaInterface::getForeignKeys()
result will be enough.
Decided to use ForeignKeyConstraint[]
instead of arrays
. Related with #734