diff --git a/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php b/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php index be6d7c5f5276..2d1a5592eeaf 100755 --- a/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php @@ -41,7 +41,7 @@ public function compileTableExists() */ public function compileColumnListing($table) { - return 'pragma table_info('.$this->wrapTable(str_replace('.', '__', $table)).')'; + return 'pragma table_info('.str_replace('.', '__', $table).')'; } /** diff --git a/tests/Database/DatabaseSchemaBuilderIntegrationTest.php b/tests/Database/DatabaseSchemaBuilderIntegrationTest.php index d752215e8444..49c542d98c30 100644 --- a/tests/Database/DatabaseSchemaBuilderIntegrationTest.php +++ b/tests/Database/DatabaseSchemaBuilderIntegrationTest.php @@ -55,4 +55,16 @@ public function testDropAllTablesWorksWithForeignKeys() $this->assertFalse($this->db->connection()->getSchemaBuilder()->hasTable('table1')); $this->assertFalse($this->db->connection()->getSchemaBuilder()->hasTable('table2')); } + + public function testHasColumnWithTablePrefix() + { + $this->db->connection()->setTablePrefix('test_'); + + $this->db->connection()->getSchemaBuilder()->create('table1', function ($table) { + $table->integer('id'); + $table->string('name'); + }); + + $this->assertTrue($this->db->connection()->getSchemaBuilder()->hasColumn('table1', 'name')); + } }