diff --git a/laravel/database/schema/grammars/postgres.php b/laravel/database/schema/grammars/postgres.php index 30bfa2f6..8eb6b4dd 100644 --- a/laravel/database/schema/grammars/postgres.php +++ b/laravel/database/schema/grammars/postgres.php @@ -146,7 +146,11 @@ public function primary(Table $table, Fluent $command) */ public function unique(Table $table, Fluent $command) { - return $this->key($table, $command, true); + $table = $this->wrap($table); + + $columns = $this->columnize($command->columns); + + return "ALTER TABLE $table ADD CONSTRAINT ".$command->name." UNIQUE ($columns)"; } /** @@ -283,7 +287,7 @@ public function drop_primary(Table $table, Fluent $command) */ public function drop_unique(Table $table, Fluent $command) { - return $this->drop_key($table, $command); + return "ALTER TABLE ".$this->wrap($table)." DROP CONSTRAINT ".$command->name; } /**