Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getForeignKeys() - inconsistency of array keys #699

Open
arogachev opened this issue Apr 13, 2023 · 4 comments
Open

getForeignKeys() - inconsistency of array keys #699

arogachev opened this issue Apr 13, 2023 · 4 comments

Comments

@arogachev
Copy link
Contributor

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']];
@samdark
Copy link
Member

samdark commented Apr 15, 2023

Do you mean that SQLite does not return FK names?

@arogachev
Copy link
Contributor Author

I mean integer and string keys difference. Maybe add docs for now.

@vjik
Copy link
Member

vjik commented Aug 8, 2023

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.

@Tigrov
Copy link
Member

Tigrov commented Aug 28, 2023

Decided to use ForeignKeyConstraint[] instead of arrays. Related with #734

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants