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

[6.x] Float database types fix #30890

Closed
wants to merge 2 commits into from
Closed
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
19 changes: 10 additions & 9 deletions src/Illuminate/Database/Schema/Blueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -787,11 +787,12 @@ public function unsignedBigInteger($column, $autoIncrement = false)
* @param string $column
* @param int $total
* @param int $places
* @param bool $unsigned
* @return \Illuminate\Database\Schema\ColumnDefinition
*/
public function float($column, $total = 8, $places = 2)
public function float($column, $total = 8, $places = 2, $unsigned = false)
{
return $this->addColumn('float', $column, compact('total', 'places'));
return $this->addColumn('float', $column, compact('total', 'places', 'unsigned'));
}

/**
Expand All @@ -800,11 +801,12 @@ public function float($column, $total = 8, $places = 2)
* @param string $column
* @param int|null $total
* @param int|null $places
* @param bool $unsigned
* @return \Illuminate\Database\Schema\ColumnDefinition
*/
public function double($column, $total = null, $places = null)
public function double($column, $total = null, $places = null, $unsigned = false)
{
return $this->addColumn('double', $column, compact('total', 'places'));
return $this->addColumn('double', $column, compact('total', 'places', 'unsigned'));
}

/**
Expand All @@ -813,11 +815,12 @@ public function double($column, $total = null, $places = null)
* @param string $column
* @param int $total
* @param int $places
* @param bool $unsigned
* @return \Illuminate\Database\Schema\ColumnDefinition
*/
public function decimal($column, $total = 8, $places = 2)
public function decimal($column, $total = 8, $places = 2, $unsigned = false)
{
return $this->addColumn('decimal', $column, compact('total', 'places'));
return $this->addColumn('decimal', $column, compact('total', 'places', 'unsigned'));
}

/**
Expand All @@ -830,9 +833,7 @@ public function decimal($column, $total = 8, $places = 2)
*/
public function unsignedDecimal($column, $total = 8, $places = 2)
{
return $this->addColumn('decimal', $column, [
'total' => $total, 'places' => $places, 'unsigned' => true,
]);
return $this->decimal($column, $total, $places, true);
}

/**
Expand Down