fix migrate jadwal

This commit is contained in:
rendygaafk 2025-05-20 04:54:22 +07:00
parent 2727e8a9de
commit b3f91d4463
2 changed files with 35 additions and 8 deletions

View File

@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
Schema::table('jadwal_bels', function (Blueprint $table) {
// Drop the old constraint
$table->dropUnique(['hari', 'file_number']);
// Add new constraint with time
$table->unique(['hari', 'waktu', 'file_number']);
});
}
public function down()
{
Schema::table('jadwal_bels', function (Blueprint $table) {
$table->dropUnique(['hari', 'waktu', 'file_number']);
$table->unique(['hari', 'file_number']);
});
}
};