Skip to content

Commit

Permalink
Fix sqlserver grammar (#13458)
Browse files Browse the repository at this point in the history
Added square brackets to the table name. This fixes issues where the table name is equal to a keyword, like user.
  • Loading branch information
fernandobandeira authored and taylorotwell committed May 6, 2016
1 parent 594e1f5 commit f35019f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
@@ -149,7 +149,7 @@ public function compileDrop(Blueprint $blueprint, Fluent $command)
*/
public function compileDropIfExists(Blueprint $blueprint, Fluent $command)
{
return 'if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = \''.$blueprint->getTable().'\') drop table '.$blueprint->getTable();
return 'if exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = \''.$blueprint->getTable().'\') drop table ['.$blueprint->getTable().']';
}

/**

0 comments on commit f35019f

Please sign in to comment.