Skip to content

Commit

Permalink
[5.5] Fix abundant table-prefix in SQLite grammar (#22781)
Browse files Browse the repository at this point in the history
* Removed abundant wrapTable in compileColumnListing

* Added assertions on column existence

* Wrap $table

* Applied StyleCI fix
  • Loading branch information
tomlankhorst authored and taylorotwell committed Jan 14, 2018
1 parent c13322c commit a32b087
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Schema/Grammars/SQLiteGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function compileTableExists()
*/
public function compileColumnListing($table)
{
return 'pragma table_info('.$this->wrapTable(str_replace('.', '__', $table)).')';
return 'pragma table_info('.$this->wrap(str_replace('.', '__', $table)).')';
}

/**
Expand Down
3 changes: 3 additions & 0 deletions tests/Database/DatabaseSQLiteSchemaGrammarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,13 @@ public function testDropColumn()
});

$this->assertTrue($schema->hasTable('users'));
$this->assertTrue($schema->hasColumn('users', 'name'));

$schema->table('users', function (Blueprint $table) {
$table->dropColumn('name');
});

$this->assertFalse($schema->hasColumn('users', 'name'));
}

/**
Expand Down

0 comments on commit a32b087

Please sign in to comment.