chore-add-migration-kasmasuk
WMS API/ERP-API/pipeline/head This commit looks good
Details
WMS API/ERP-API/pipeline/head This commit looks good
Details
This commit is contained in:
parent
23e9a6a2f2
commit
566d3b6c4f
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration {
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('kas_masuks', function (Blueprint $table) {
|
||||||
|
$table->unsignedBigInteger('coa_id')->nullable()->after('user_id'); // Tambahkan kolom COA
|
||||||
|
$table->foreign('coa_id')->references('id')->on('coas')->onDelete('set null'); // Relasi ke tabel COA
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('kas_masuks', function (Blueprint $table) {
|
||||||
|
$table->dropForeign(['coa_id']);
|
||||||
|
$table->dropColumn('coa_id');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
Loading…
Reference in New Issue