Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Combine prefix with table for compileDropPrimary PostgreSQL #48268

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Illuminate/Database/Schema/Blueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
}
Expand Down