Update Migration & Seeder

This commit is contained in:
2026-05-26 09:38:38 +07:00
parent 9231f25e5d
commit e4f7d675a1
12 changed files with 71 additions and 215 deletions
@@ -23,9 +23,22 @@ return new class extends Migration
$table->softDeletes();
});
Schema::create('jenis_komoditas', function (Blueprint $table) {
$table->id();
$table->foreignId('komoditas_id')->constrained('master_komoditas')->onDelete('cascade');
$table->string('nama');
$table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null');
$table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null');
$table->timestamps();
$table->softDeletes();
});
Schema::create('master_varietas', function (Blueprint $table) {
$table->id();
$table->foreignId('komoditas_id')->constrained('master_komoditas')->onDelete('cascade');
$table->foreignId('jenis_komoditas_id')->constrained('jenis_komoditas')->onDelete('cascade');
$table->string('nama');
$table->text('deskripsi')->unique();
@@ -37,13 +50,11 @@ return new class extends Migration
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('master_komoditas');
Schema::dropIfExists('master_varietas');
Schema::dropIfExists('jenis_komoditas');
Schema::dropIfExists('master_komoditas');
}
};