<?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('product_photos', function (Blueprint $table) {
            $table->id('product_photo_id');
            $table->foreignId('product_photo_product_id')->references('mainProductID')->on('mainproducts')->cascadeOnDelete();
            $table->foreignId('product_photo_vendor_id')->references('vendor_id')->on('vendors')->cascadeOnDelete();
            $table->integer('product_photo_state')->default(1);
            $table->char('mainProductPhoto', 255)->nullable();
            $table->timestamps();
        });
    }

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