Skip to content

Commit b061b9b

Browse files
committed
Merge pull request laravel#1150 from franzliedke/patch-40
Get rid of duplicate code for DROP TABLE in schema grammars.
2 parents 852b10e + e11d13a commit b061b9b

File tree

5 files changed

+12
-48
lines changed

5 files changed

+12
-48
lines changed

laravel/database/schema/grammars/grammar.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ public function foreign(Table $table, Fluent $command)
5050
return $sql;
5151
}
5252

53+
/**
54+
* Generate the SQL statement for a drop table command.
55+
*
56+
* @param Table $table
57+
* @param Fluent $command
58+
* @return string
59+
*/
60+
public function drop(Table $table, Fluent $command)
61+
{
62+
return 'DROP TABLE '.$this->wrap($table);
63+
}
64+
5365
/**
5466
* Drop a constraint from the table.
5567
*

laravel/database/schema/grammars/mysql.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -224,18 +224,6 @@ public function rename(Table $table, Fluent $command)
224224
return 'RENAME TABLE '.$this->wrap($table).' TO '.$this->wrap($command->name);
225225
}
226226

227-
/**
228-
* Generate the SQL statement for a drop table command.
229-
*
230-
* @param Table $table
231-
* @param Fluent $command
232-
* @return string
233-
*/
234-
public function drop(Table $table, Fluent $command)
235-
{
236-
return 'DROP TABLE '.$this->wrap($table);
237-
}
238-
239227
/**
240228
* Generate the SQL statement for a drop column command.
241229
*

laravel/database/schema/grammars/postgres.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -210,18 +210,6 @@ public function rename(Table $table, Fluent $command)
210210
return 'ALTER TABLE '.$this->wrap($table).' RENAME TO '.$this->wrap($command->name);
211211
}
212212

213-
/**
214-
* Generate the SQL statement for a drop table command.
215-
*
216-
* @param Table $table
217-
* @param Fluent $command
218-
* @return string
219-
*/
220-
public function drop(Table $table, Fluent $command)
221-
{
222-
return 'DROP TABLE '.$this->wrap($table);
223-
}
224-
225213
/**
226214
* Generate the SQL statement for a drop column command.
227215
*

laravel/database/schema/grammars/sqlite.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -213,18 +213,6 @@ public function rename(Table $table, Fluent $command)
213213
return 'ALTER TABLE '.$this->wrap($table).' RENAME TO '.$this->wrap($command->name);
214214
}
215215

216-
/**
217-
* Generate the SQL statement for a drop table command.
218-
*
219-
* @param Table $table
220-
* @param Fluent $command
221-
* @return string
222-
*/
223-
public function drop(Table $table, Fluent $command)
224-
{
225-
return 'DROP TABLE '.$this->wrap($table);
226-
}
227-
228216
/**
229217
* Generate the SQL statement for a drop unique key command.
230218
*

laravel/database/schema/grammars/sqlserver.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -224,18 +224,6 @@ public function rename(Table $table, Fluent $command)
224224
return 'ALTER TABLE '.$this->wrap($table).' RENAME TO '.$this->wrap($command->name);
225225
}
226226

227-
/**
228-
* Generate the SQL statement for a drop table command.
229-
*
230-
* @param Table $table
231-
* @param Fluent $command
232-
* @return string
233-
*/
234-
public function drop(Table $table, Fluent $command)
235-
{
236-
return 'DROP TABLE '.$this->wrap($table);
237-
}
238-
239227
/**
240228
* Generate the SQL statement for a drop column command.
241229
*

0 commit comments

Comments
 (0)