Skip to content

Commit

Permalink
Fix drop unique index
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolaj Boel Jensen committed Sep 8, 2018
1 parent 30779ba commit bc10640
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/vendor/
/.idea
.php_cs.cache
3 changes: 2 additions & 1 deletion src/Cockroach/Grammar/Schema/CockroachGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,9 @@ public function compileDropPrimary(Blueprint $blueprint, Fluent $command)
public function compileDropUnique(Blueprint $blueprint, Fluent $command)
{
$index = $this->wrap($command->index);
$table = $this->wrapTable($blueprint);

return "alter table {$this->wrapTable($blueprint)} drop constraint {$index}";
return "drop index {$table}@{$index} cascade";
}

/**
Expand Down

0 comments on commit bc10640

Please sign in to comment.