feat: add foreign key id_user to paket_fotos table for user association

This commit is contained in:
LailaWulandarii 2026-02-26 08:50:55 +07:00
parent ddaca1ab98
commit fcc1ab0c04
1 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('paket_fotos', function (Blueprint $table) {
$table->foreignId('id_user')->after('id_paket')->nullable()->constrained('users', 'id_user')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('paket_fotos', function (Blueprint $table) {
//
});
}
};