Commit b7d068f2 by Colin Viebrock

Move method into grammar.php instead of duplicating in each grammar

parent 26c72734
...@@ -39,4 +39,19 @@ abstract class Grammar extends \Laravel\Database\Grammar { ...@@ -39,4 +39,19 @@ abstract class Grammar extends \Laravel\Database\Grammar {
return parent::wrap($value); return parent::wrap($value);
} }
/**
* 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';
}
}
} }
\ No newline at end of file
...@@ -91,21 +91,6 @@ class MySQL extends Grammar { ...@@ -91,21 +91,6 @@ class MySQL extends Grammar {
} }
/** /**
* 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. * Get the SQL syntax for indicating if a column is nullable.
* *
* @param Table $table * @param Table $table
......
...@@ -79,21 +79,6 @@ class Postgres extends Grammar { ...@@ -79,21 +79,6 @@ class Postgres extends Grammar {
} }
/** /**
* 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. * Get the SQL syntax for indicating if a column is nullable.
* *
* @param Table $table * @param Table $table
......
...@@ -105,21 +105,6 @@ class SQLite extends Grammar { ...@@ -105,21 +105,6 @@ class SQLite extends Grammar {
} }
/** /**
* 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. * Get the SQL syntax for indicating if a column is nullable.
* *
* @param Table $table * @param Table $table
......
...@@ -86,21 +86,6 @@ class SQLServer extends Grammar { ...@@ -86,21 +86,6 @@ class SQLServer extends Grammar {
} }
/** /**
* 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. * Get the SQL syntax for indicating if a column is nullable.
* *
* @param Table $table * @param Table $table
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment