Open joisarjignesh opened 5 years ago
if we want to drop column if exists in table laravel migration
now we are using like that
if (Schema::hasColumn('tableName', 'columnName')) { Schema::table('tableName', function (Blueprint $table) { $table->dropColumn('columnName'); }); }
it's better use like that directly
Schema::table('tableName', function (Blueprint $table) { $table->dropColumnIfExists('columnName'); });
pretty clear
I want this.
if we want to drop column if exists in table laravel migration
it's better use like that directly