User

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

<?

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::create('picture_user', function (Blueprint $table) {
$table->id();
$table->integer('picture_id')->unsigned();
$table->integer('user_id')->unsigned();
$table->foreign('picture_id')->references('id')->on('pictures')-
>onDelete('cascade');
$table->foreign('user_id')->references('id')->on('user')-
>onDelete('cascade');

$table->timestamps();
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('picture_user');
}
};

You might also like