menghapus apa yang sudah ada di detail_dokumen_jaminan
This commit is contained in:
@@ -1,33 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Modules\Lpj\Models\JenisLampiran;
|
|
||||||
|
|
||||||
return new class extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*/
|
|
||||||
public function up(): void
|
|
||||||
{
|
|
||||||
Schema::table('lampiran_dokumen', function (Blueprint $table) {
|
|
||||||
$table->foreignIdFor(JenisLampiran::class)->constrained('jenis_lampiran')->onDelete('cascade')->nullable();
|
|
||||||
});
|
|
||||||
|
|
||||||
DB::update("UPDATE detail_dokumen_jaminan SET details = CONCAT('[', details, ']') WHERE details NOT LIKE '[%]' and details IS NOT NULL and details !=''");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::table('lampiran_dokumen', function (Blueprint $table) {
|
|
||||||
$table->dropForeign(['jenis_lampiran_id']);
|
|
||||||
$table->dropColumn('jenis_lampiran_id');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user