File: /var/www/ipsremont-demo/database/migrations/2024_05_15_140000_create_repair_attachments.php
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateRepairAttachments extends Migration
{
public function up()
{
Schema::create('repair_attachments', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('repair_id')->nullable();
$table->string('path');
$table->string('original_name');
$table->timestamps();
$table->foreign('repair_id')->references('id')->on('repairs')->onDelete('no action');
});
}
public function down()
{
Schema::dropIfExists('repair_attachments');
}
}