diff --git a/src/Illuminate/Database/Schema/Blueprint.php b/src/Illuminate/Database/Schema/Blueprint.php index 74b584b51a68..f41123aca642 100755 --- a/src/Illuminate/Database/Schema/Blueprint.php +++ b/src/Illuminate/Database/Schema/Blueprint.php @@ -1785,6 +1785,16 @@ public function getTable() return $this->table; } + /** + * Get the table prefix. + * + * @return string + */ + public function getPrefix() + { + return $this->prefix; + } + /** * Get the columns on the blueprint. * diff --git a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php b/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php index e01aa947fe35..2efb2541525f 100755 --- a/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php +++ b/src/Illuminate/Database/Schema/Grammars/PostgresGrammar.php @@ -427,7 +427,7 @@ public function compileDropColumn(Blueprint $blueprint, Fluent $command) */ public function compileDropPrimary(Blueprint $blueprint, Fluent $command) { - $index = $this->wrap("{$blueprint->getTable()}_pkey"); + $index = $this->wrap("{$blueprint->getPrefix()}{$blueprint->getTable()}_pkey"); return 'alter table '.$this->wrapTable($blueprint)." drop constraint {$index}"; }