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

[5.3] Allow reserved words as table name in sqlite #17293

Merged
merged 2 commits into from
Jan 12, 2017

Conversation

lewisf2001uk
Copy link
Contributor

When using sqlite the below fails as group is a reserved word.
Schema::getColumnListing('group');

@lewisf2001uk lewisf2001uk changed the title Allow reserved words as table name [5.3] Allow reserved words as table name in sqlite Jan 12, 2017
@@ -40,7 +40,7 @@ public function compileTableExists()
*/
public function compileColumnExists($table)
{
return 'pragma table_info('.str_replace('.', '__', $table).')';
return 'pragma table_info(`'.str_replace('.', '__', $table).'`)';
Copy link
Contributor

@fernandobandeira fernandobandeira Jan 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could call $this->wrapTable(str_replace('.', '__', $table)) instead of hardcoding the ` character....

@lewisf2001uk
Copy link
Contributor Author

Thank you for the suggestion @fernandobandeira. This has now been done.

@taylorotwell taylorotwell merged commit e9e79cc into laravel:5.3 Jan 12, 2017
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

Successfully merging this pull request may close these issues.

3 participants