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

SQLiteGrammer compileColumnListing tablePrefix added twice #18255

Closed
pakomp opened this issue Mar 8, 2017 · 0 comments
Closed

SQLiteGrammer compileColumnListing tablePrefix added twice #18255

pakomp opened this issue Mar 8, 2017 · 0 comments

Comments

@pakomp
Copy link

pakomp commented Mar 8, 2017

  • Laravel Version: 5.4.15
  • PHP Version: 7.1.1
  • Database Driver & Version: SQLite

Description:

Schema::hasColumn('table','column') doesnt work for SQLite connections when using prefix since first Schema\Builder->getColumnListing adds the prefix, but it also gets added once more in Schema\Grammars\SQLiteGrammar->compileColumnListing by Grammar\wrapTable I'm guessing.
Using other drivers work since they dont add the prefix in compileColumnListing.

Steps To Reproduce:

config/database.php:
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => 'test',
],

migration:
Schema::create('table', function (Blueprint $table) {
$table->string('column');
}

Later calling Schema::hasColumn('table','column')
will end up executing
pragma table_info("test_test_table")
in Schema\Builder->getColumnListing

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