From 46595ce55e186e116ec0735a4c995987c063d60a Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sun, 4 Mar 2012 14:28:49 -0600 Subject: [PATCH] Unsigned only supported by MySQL. Signed-off-by: Taylor Otwell --- laravel/database/schema/grammars/grammar.php | 15 --------------- laravel/database/schema/grammars/mysql.php | 15 +++++++++++++++ laravel/database/schema/grammars/postgres.php | 2 +- laravel/database/schema/grammars/sqlite.php | 2 +- laravel/database/schema/grammars/sqlserver.php | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/laravel/database/schema/grammars/grammar.php b/laravel/database/schema/grammars/grammar.php index 512db2be..ad0dfbcc 100644 --- a/laravel/database/schema/grammars/grammar.php +++ b/laravel/database/schema/grammars/grammar.php @@ -47,21 +47,6 @@ protected function drop_constraint(Table $table, Fluent $command) return "ALTER TABLE ".$this->wrap($table)." DROP CONSTRAINT ".$command->name; } - /** - * 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'; - } - } - /** * Wrap a value in keyword identifiers. * diff --git a/laravel/database/schema/grammars/mysql.php b/laravel/database/schema/grammars/mysql.php index a41991d3..c2ae7455 100644 --- a/laravel/database/schema/grammars/mysql.php +++ b/laravel/database/schema/grammars/mysql.php @@ -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 acce7f7b..760af1a8 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('unsigned', 'incrementer', 'nullable', 'defaults'); + $elements = array('incrementer', 'nullable', 'defaults'); foreach ($elements as $element) { diff --git a/laravel/database/schema/grammars/sqlite.php b/laravel/database/schema/grammars/sqlite.php index c6d209e4..9e148a5d 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('unsigned', 'nullable', 'defaults', 'incrementer'); + $elements = array('nullable', 'defaults', 'incrementer'); foreach ($elements as $element) { diff --git a/laravel/database/schema/grammars/sqlserver.php b/laravel/database/schema/grammars/sqlserver.php index dea4729e..0fb80f6a 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('unsigned', 'incrementer', 'nullable', 'defaults'); + $elements = array('incrementer', 'nullable', 'defaults'); foreach ($elements as $element) {