feat: tambah penanggung jawab divisi (leader_id) dari role pengurus
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('divisions', function (Blueprint $table) {
|
||||
$table->foreignId('leader_id')->nullable()->constrained('users')->nullOnDelete()->after('description');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('divisions', function (Blueprint $table) {
|
||||
$table->dropForeignIdFor(\App\Models\User::class, 'leader_id');
|
||||
$table->dropColumn('leader_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user