28 lines
922 B
PHP
28 lines
922 B
PHP
<?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::create('sops', function (Blueprint $table) {
|
|
$table->id(); // 1. id sop
|
|
$table->string('title'); // 2. judul
|
|
$table->string('sop_code')->unique(); // 3. kode_sop
|
|
$table->string('category_name')->nullable(); // 4. kategori name
|
|
$table->string('version')->default('1.0'); // 5. versi
|
|
$table->text('revision_history')->nullable(); // 6. historical rev sop (bisa diset text atau json)
|
|
$table->enum('status', ['Draft', 'Active', 'Obsolete'])->default('Active'); // 7. status sop
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('sops');
|
|
}
|
|
};
|