drop unused columns

parent 18e73443
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('overtime_request_detail', function (Blueprint $table) {
$columns = [
'ord_day_type',
'ord_office_start',
'ord_office_end',
'ord_time_from',
'ord_time_to',
'ord_tasks',
];
foreach ($columns as $column) {
if (Schema::hasColumn('overtime_request_detail', $column)) {
$table->dropColumn($column);
}
}
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
// Left blank because the columns already not in local.
}
};
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment