sementara
This commit is contained in:
BIN
database/.DS_Store
vendored
Normal file
BIN
database/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -0,0 +1,45 @@
|
||||
<?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::create('referensi_link', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('name', 255)->nullable(false)->comment('Nama referensi link');
|
||||
$table->text('link')->nullable(false)->comment('URL link referensi');
|
||||
$table->string('kategori', 100)->nullable()->comment('Kategori referensi (misal: regulasi, panduan, dll)');
|
||||
$table->text('deskripsi')->nullable()->comment('Deskripsi lengkap referensi');
|
||||
$table->boolean('is_active')->default(true)->comment('Status aktif referensi');
|
||||
$table->integer('urutan')->default(0)->comment('Urutan tampil referensi');
|
||||
$table->unsignedBigInteger('created_by')->nullable()->comment('ID user yang membuat');
|
||||
$table->unsignedBigInteger('updated_by')->nullable()->comment('ID user yang update terakhir');
|
||||
$table->timestamps();
|
||||
|
||||
// Indexes
|
||||
$table->index('kategori');
|
||||
$table->index('is_active');
|
||||
$table->index('urutan');
|
||||
$table->index('created_by');
|
||||
|
||||
// Foreign keys
|
||||
$table->foreign('created_by')->references('id')->on('users')->onDelete('set null');
|
||||
$table->foreign('updated_by')->references('id')->on('users')->onDelete('set null');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('referensi_link');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user