Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 30, 2019
1 parent 04ebdb3 commit 1c74d7f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 27 deletions.
24 changes: 12 additions & 12 deletions src/Illuminate/Database/Schema/Blueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -822,18 +822,6 @@ public function unsignedDecimal($column, $total = 8, $places = 2)
]);
}

/**
* Create a new generated computed column on the table.
*
* @param string $column
* @param string $expression
* @return \Illuminate\Database\Schema\ColumnDefinition
*/
public function computed($column, $expression)
{
return $this->addColumn('computed', $column, compact('expression'));
}

/**
* Create a new boolean column on the table.
*
Expand Down Expand Up @@ -1169,6 +1157,18 @@ public function multiPolygon($column)
return $this->addColumn('multipolygon', $column);
}

/**
* Create a new generated, computed column on the table.
*
* @param string $column
* @param string $expression
* @return \Illuminate\Database\Schema\ColumnDefinition
*/
public function computed($column, $expression)
{
return $this->addColumn('computed', $column, compact('expression'));
}

/**
* Add the proper columns for a polymorphic table.
*
Expand Down
25 changes: 13 additions & 12 deletions src/Illuminate/Database/Schema/Grammars/Grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,19 @@ protected function getType(Fluent $column)
return $this->{'type'.ucfirst($column->type)}($column);
}

/**
* Create the column definition for a generated, computed column type.
*
* @param \Illuminate\Support\Fluent $column
* @return void
*
* @throws \RuntimeException
*/
protected function typeComputed(Fluent $column)
{
throw new RuntimeException('This database driver does not support the computed type.');
}

/**
* Add the column modifiers to the definition.
*
Expand Down Expand Up @@ -191,18 +204,6 @@ public function prefixArray($prefix, array $values)
}, $values);
}

/**
* Create the column definition for a generated computed column type.
*
* @param \Illuminate\Support\Fluent $column
*
* @throws \RuntimeException
*/
protected function typeComputed(Fluent $column)
{
throw new RuntimeException('The database driver in use does not support the computed type.');
}

/**
* Wrap a table in keyword identifiers.
*
Expand Down
5 changes: 3 additions & 2 deletions src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -835,15 +835,16 @@ public function typeMultiPolygon(Fluent $column)
}

/**
* Create the column definition for a generated computed column type.
* Create the column definition for a generated, computed column type.
*
* @param \Illuminate\Support\Fluent $column
* @return void
*
* @throws \RuntimeException
*/
protected function typeComputed(Fluent $column)
{
throw new RuntimeException('The database driver in use requires a type, see virtualAs/storedAs modifiers.');
throw new RuntimeException('This database driver requires a type, see the virtualAs / storedAs modifiers.');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ public function typeMultiPolygon(Fluent $column)
}

/**
* Create the column definition for a generated computed column type.
* Create the column definition for a generated, computed column type.
*
* @param \Illuminate\Support\Fluent $column
* @return string|null
Expand Down

0 comments on commit 1c74d7f

Please sign in to comment.