diff --git a/laravel/database/schema/grammars/mysql.php b/laravel/database/schema/grammars/mysql.php index 48542de3..caa76c7e 100644 --- a/laravel/database/schema/grammars/mysql.php +++ b/laravel/database/schema/grammars/mysql.php @@ -77,7 +77,7 @@ protected function columns(Table $table) // types to the correct types. $sql = $this->wrap($column).' '.$this->type($column); - $elements = array('nullable', 'defaults', 'incrementer'); + $elements = array('unsigned', 'nullable', 'defaults', 'incrementer'); foreach ($elements as $element) { @@ -90,6 +90,21 @@ protected function columns(Table $table) 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. * diff --git a/laravel/database/schema/grammars/postgres.php b/laravel/database/schema/grammars/postgres.php index fc4096ac..797de6bb 100644 --- a/laravel/database/schema/grammars/postgres.php +++ b/laravel/database/schema/grammars/postgres.php @@ -65,7 +65,7 @@ protected function columns(Table $table) // 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) { @@ -78,6 +78,21 @@ protected function columns(Table $table) 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. * diff --git a/laravel/database/schema/grammars/sqlite.php b/laravel/database/schema/grammars/sqlite.php index 30bd5bb0..e6e3d95b 100644 --- a/laravel/database/schema/grammars/sqlite.php +++ b/laravel/database/schema/grammars/sqlite.php @@ -91,7 +91,7 @@ protected function columns(Table $table) // types to the types used by the database. $sql = $this->wrap($column).' '.$this->type($column); - $elements = array('nullable', 'defaults', 'incrementer'); + $elements = array('unsigned', 'nullable', 'defaults', 'incrementer'); foreach ($elements as $element) { @@ -104,6 +104,21 @@ protected function columns(Table $table) 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. * diff --git a/laravel/database/schema/grammars/sqlserver.php b/laravel/database/schema/grammars/sqlserver.php index eb6eb785..7b8d9619 100644 --- a/laravel/database/schema/grammars/sqlserver.php +++ b/laravel/database/schema/grammars/sqlserver.php @@ -72,7 +72,7 @@ protected function columns(Table $table) // 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 @@ protected function columns(Table $table) 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. *