From d693e9df6787f0b74af4a565045c9a1bb480d3b4 Mon Sep 17 00:00:00 2001 From: Daeng Deni Mardaeni Date: Thu, 26 Sep 2024 10:59:21 +0700 Subject: [PATCH 1/3] update table penilaian --- .../2024_09_05_070712_create_penilaian_table.php | 5 +---- .../2024_09_26_021850_update_penilaian_table.php | 11 +++++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/database/migrations/2024_09_05_070712_create_penilaian_table.php b/database/migrations/2024_09_05_070712_create_penilaian_table.php index cb0a397..93670c0 100644 --- a/database/migrations/2024_09_05_070712_create_penilaian_table.php +++ b/database/migrations/2024_09_05_070712_create_penilaian_table.php @@ -20,10 +20,7 @@ return new class () extends Migration { $table->datetime('tanggal_kunjungan'); $table->text('keterangan')->nullable(); $table->string('status')->nullable(); - $table->string('nomor_registrasi')->references('nomor_registrasi')->on(Permohonan::class)->nullable(); - $table->integer('penilaian_id')->nullable(); - $table->integer('surveyor_id')->nullable(); - $table->integer('penilai_surveyor_id')->nullable(); + $table->unsignedBigInteger('user_id'); $table->timestamps(); $table->char('authorized_status', 1)->nullable(); $table->timestamp('authorized_at')->nullable(); diff --git a/database/migrations/2024_09_26_021850_update_penilaian_table.php b/database/migrations/2024_09_26_021850_update_penilaian_table.php index 80f7db0..78f60d3 100644 --- a/database/migrations/2024_09_26_021850_update_penilaian_table.php +++ b/database/migrations/2024_09_26_021850_update_penilaian_table.php @@ -3,8 +3,9 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; + use Modules\Lpj\Models\Permohonan; -return new class extends Migration + return new class extends Migration { /** * Run the migrations. @@ -12,10 +13,11 @@ return new class extends Migration public function up(): void { Schema::table('penilaian', function (Blueprint $table) { + $table->dropColumn('user_id'); $table->string('nomor_registrasi')->references('nomor_registrasi')->on(Permohonan::class)->onDelete('cascade'); - $table->integer('penilai_id')->unsigned()->nullable(); - $table->integer('surveyor_id')->unsigned()->nullable(); - $table->integer('penilai_surveyor_id')->unsigned()->nullable(); + $table->unsignedBigInteger('penilaian_id')->unsigned()->nullable(); + $table->unsignedBigInteger('surveyor_id')->unsigned()->nullable(); + $table->unsignedBigInteger('penilai_surveyor_id')->unsigned()->nullable(); }); } @@ -25,6 +27,7 @@ return new class extends Migration public function down(): void { Schema::table('penilaian', function (Blueprint $table) { + $table->unsignedBigInteger('user_id')->unsigned(); $table->dropForeign(['nomor_registrasi']); $table->dropForeign(['penilai_id']); $table->dropForeign(['surveyor_id']); From 51deedf9bee0d842fbbd8faf3391ee66bc61a752 Mon Sep 17 00:00:00 2001 From: Daeng Deni Mardaeni Date: Thu, 26 Sep 2024 11:14:04 +0700 Subject: [PATCH 2/3] fix update migration table penilaian --- .../migrations/2024_09_26_021850_update_penilaian_table.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/database/migrations/2024_09_26_021850_update_penilaian_table.php b/database/migrations/2024_09_26_021850_update_penilaian_table.php index 78f60d3..91d680e 100644 --- a/database/migrations/2024_09_26_021850_update_penilaian_table.php +++ b/database/migrations/2024_09_26_021850_update_penilaian_table.php @@ -28,12 +28,8 @@ use Illuminate\Support\Facades\Schema; { Schema::table('penilaian', function (Blueprint $table) { $table->unsignedBigInteger('user_id')->unsigned(); - $table->dropForeign(['nomor_registrasi']); - $table->dropForeign(['penilai_id']); - $table->dropForeign(['surveyor_id']); - $table->dropForeign(['penilai_surveyor_id']); $table->dropColumn('nomor_registrasi'); - $table->dropColumn('penilai_id'); + $table->dropColumn('penilaian_id'); $table->dropColumn('surveyor_id'); $table->dropColumn('penilai_surveyor_id'); }); From a93b32c878d8acaae2ab0f4ef45765ad99159b06 Mon Sep 17 00:00:00 2001 From: Daeng Deni Mardaeni Date: Fri, 27 Sep 2024 11:18:03 +0700 Subject: [PATCH 3/3] restore migration branch --- ...024_08_12_023807_create_branches_table.php | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 database/migrations/2024_08_12_023807_create_branches_table.php diff --git a/database/migrations/2024_08_12_023807_create_branches_table.php b/database/migrations/2024_08_12_023807_create_branches_table.php new file mode 100644 index 0000000..bf4e9a8 --- /dev/null +++ b/database/migrations/2024_08_12_023807_create_branches_table.php @@ -0,0 +1,39 @@ +id(); + $table->string('code', 9)->unique(); + $table->string('name'); + $table->boolean('status')->default(true)->nullable(); + $table->timestamps(); + $table->timestamp('authorized_at')->nullable(); + $table->char('authorized_status', 1)->nullable(); + $table->softDeletes(); + + $table->unsignedBigInteger('created_by')->nullable(); + $table->unsignedBigInteger('updated_by')->nullable(); + $table->unsignedBigInteger('deleted_by')->nullable(); + $table->unsignedBigInteger('authorized_by')->nullable(); + }); + } + + /** + * Reverse the migrations. + */ + public function down() + : void + { + Schema::dropIfExists('branches'); + } + };