From b7d068f2f2f586271c158de2bb3e00fbd9ad0030 Mon Sep 17 00:00:00 2001 From: Colin Viebrock Date: Wed, 29 Feb 2012 15:21:20 -0600 Subject: [PATCH] Move method into grammar.php instead of duplicating in each grammar --- laravel/database/schema/grammars/grammar.php | 15 +++++++++++++++ laravel/database/schema/grammars/mysql.php | 15 --------------- laravel/database/schema/grammars/postgres.php | 15 --------------- laravel/database/schema/grammars/sqlite.php | 15 --------------- laravel/database/schema/grammars/sqlserver.php | 15 --------------- 5 files changed, 15 insertions(+), 60 deletions(-) diff --git a/laravel/database/schema/grammars/grammar.php b/laravel/database/schema/grammars/grammar.php index ac5b20ea..8212e219 100644 --- a/laravel/database/schema/grammars/grammar.php +++ b/laravel/database/schema/grammars/grammar.php @@ -39,4 +39,19 @@ public function 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 diff --git a/laravel/database/schema/grammars/mysql.php b/laravel/database/schema/grammars/mysql.php index caa76c7e..595c1dd8 100644 --- a/laravel/database/schema/grammars/mysql.php +++ b/laravel/database/schema/grammars/mysql.php @@ -90,21 +90,6 @@ 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 797de6bb..b974efc9 100644 --- a/laravel/database/schema/grammars/postgres.php +++ b/laravel/database/schema/grammars/postgres.php @@ -78,21 +78,6 @@ 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 e6e3d95b..9fcbce2a 100644 --- a/laravel/database/schema/grammars/sqlite.php +++ b/laravel/database/schema/grammars/sqlite.php @@ -104,21 +104,6 @@ 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 7b8d9619..6cf1bffb 100644 --- a/laravel/database/schema/grammars/sqlserver.php +++ b/laravel/database/schema/grammars/sqlserver.php @@ -85,21 +85,6 @@ 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. *