Skip to content

Commit fcd7e64

Browse files
authored
Revert "[11.x] Added dropColumnsIfExists, dropColumnIfExists and `dropFor…" (#53338)
This reverts commit b6e478d.
1 parent a8363e4 commit fcd7e64

File tree

2 files changed

+0
-53
lines changed

2 files changed

+0
-53
lines changed

src/Illuminate/Database/Schema/Blueprint.php

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Illuminate\Database\Schema\Grammars\Grammar;
1010
use Illuminate\Database\Schema\Grammars\MySqlGrammar;
1111
use Illuminate\Database\Schema\Grammars\SQLiteGrammar;
12-
use Illuminate\Support\Facades\Schema;
1312
use Illuminate\Support\Fluent;
1413
use Illuminate\Support\Traits\Macroable;
1514

@@ -428,25 +427,6 @@ public function dropColumn($columns)
428427
return $this->addCommand('dropColumn', compact('columns'));
429428
}
430429

431-
/**
432-
* Indicate that the given columns should be dropped if they exist.
433-
*
434-
* @param array|mixed $columns
435-
* @return \Illuminate\Support\Fluent
436-
*/
437-
public function dropColumnIfExists($columns)
438-
{
439-
$columns = is_array($columns) ? $columns : func_get_args();
440-
441-
$columns = array_intersect($columns, Schema::getColumnListing($this->getTable()));
442-
443-
if (empty($columns)) {
444-
return new Fluent;
445-
}
446-
447-
return $this->dropColumn($columns);
448-
}
449-
450430
/**
451431
* Indicate that the given columns should be renamed.
452432
*
@@ -525,25 +505,6 @@ public function dropForeign($index)
525505
return $this->dropIndexCommand('dropForeign', 'foreign', $index);
526506
}
527507

528-
/**
529-
* Indicate that the given foreign key should be dropped if it exists.
530-
*
531-
* @param string|array $index
532-
* @return \Illuminate\Support\Fluent
533-
*/
534-
public function dropForeignIfExists($index)
535-
{
536-
if (is_array($index)) {
537-
$index = $this->createIndexName('foreign', $index);
538-
}
539-
540-
if (! in_array($index, Schema::getForeignKeys($this->getTable()))) {
541-
return new Fluent;
542-
}
543-
544-
return $this->dropIndexCommand('dropForeign', 'foreign', $index);
545-
}
546-
547508
/**
548509
* Indicate that the given column and foreign key should be dropped.
549510
*

src/Illuminate/Database/Schema/Builder.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -462,20 +462,6 @@ public function dropColumns($table, $columns)
462462
});
463463
}
464464

465-
/**
466-
* Drop columns from a table schema if they exist.
467-
*
468-
* @param string $table
469-
* @param string|array $columns
470-
* @return void
471-
*/
472-
public function dropColumnsIfExists($table, $columns)
473-
{
474-
$this->table($table, function (Blueprint $blueprint) use ($columns) {
475-
$blueprint->dropColumnIfExists($columns);
476-
});
477-
}
478-
479465
/**
480466
* Drop all tables from the database.
481467
*

0 commit comments

Comments
 (0)