Update Migration & Seeder
This commit is contained in:
@@ -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');
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user