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

SQLiteDriver exception from getForeignKeys - incorrect results from PRAGMA foreign_key_list #281

Closed
SlavaAurim opened this issue Aug 8, 2021 · 0 comments

Comments

@SlavaAurim
Copy link

This line throws exception:

if ($keys[$row['id']]['foreign'][0] == null) {

...because my sqlite (in php 8) return NULL in column 'to' in results from PRAGMA foreign_key_list(tablename)
Another columns has correct data.

This is simple fix:

if ($keys[$row['id']]['foreign'] //<== check if equal null
		&& $keys[$row['id']]['foreign'][0] == null) {
		$keys[$row['id']]['foreign'] = null;		
}
@SlavaAurim SlavaAurim changed the title SQLiteDriver incorrect getForeignKeys SQLiteDriver exception from getForeignKeys - incorrect results from PRAGMA foreign_key_list Aug 8, 2021
@dg dg closed this as completed Jan 19, 2022
dg added a commit that referenced this issue Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants