Add unsigned() modifier, so you can create unsigned integer columns
This commit is contained in:
@@ -72,7 +72,7 @@ class SQLServer extends Grammar {
|
||||
// types to the types used by the database.
|
||||
$sql = $this->wrap($column).' '.$this->type($column);
|
||||
|
||||
$elements = array('incrementer', 'nullable', 'defaults');
|
||||
$elements = array('unsigned', 'incrementer', 'nullable', 'defaults');
|
||||
|
||||
foreach ($elements as $element)
|
||||
{
|
||||
@@ -85,6 +85,21 @@ class SQLServer extends Grammar {
|
||||
return $columns;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the SQL syntax for indicating if a column is unsigned.
|
||||
*
|
||||
* @param Table $table
|
||||
* @param Fluent $column
|
||||
* @return string
|
||||
*/
|
||||
protected function unsigned(Table $table, Fluent $column)
|
||||
{
|
||||
if ($column->type == 'integer' && $column->unsigned)
|
||||
{
|
||||
return ' UNSIGNED';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the SQL syntax for indicating if a column is nullable.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user