Skip to content

Commit

Permalink
Make sure float, double and decimal are signed (#30891)
Browse files Browse the repository at this point in the history
  • Loading branch information
mnabialek authored and taylorotwell committed Dec 23, 2019
1 parent 878f159 commit 7924520
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Illuminate/Database/Schema/Blueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,9 @@ public function unsignedBigInteger($column, $autoIncrement = false)
*/
public function float($column, $total = 8, $places = 2)
{
return $this->addColumn('float', $column, compact('total', 'places'));
return $this->addColumn('float', $column, [
'total' => $total, 'places' => $places, 'unsigned' => false,
]);
}

/**
Expand All @@ -804,7 +806,9 @@ public function float($column, $total = 8, $places = 2)
*/
public function double($column, $total = null, $places = null)
{
return $this->addColumn('double', $column, compact('total', 'places'));
return $this->addColumn('double', $column, [
'total' => $total, 'places' => $places, 'unsigned' => false,
]);
}

/**
Expand All @@ -817,7 +821,9 @@ public function double($column, $total = null, $places = null)
*/
public function decimal($column, $total = 8, $places = 2)
{
return $this->addColumn('decimal', $column, compact('total', 'places'));
return $this->addColumn('decimal', $column, [
'total' => $total, 'places' => $places, 'unsigned' => false,
]);
}

/**
Expand Down

0 comments on commit 7924520

Please sign in to comment.