<?php

use App\Models\Devis;
use App\Models\Piece;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('devis_piece', function (Blueprint $table) {
            $table->id();
            $table->foreignIdFor(Piece::class)->onDelete(null);
            $table->foreignIdFor(Devis::class)->onDelete(null);
            $table->integer('qte');
            $table->timestamps();
        });
    }

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