Files
OrderCheck/database/migrations/2026_06_13_071243_create_attachments_table.php
2026-06-15 08:13:42 +02:00

32 lines
815 B
PHP

<?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('attachments', function (Blueprint $table) {
$table->id();
$table->foreignId('order_id')->constrained()->cascadeOnDelete();
$table->string('file_path');
$table->string('file_name');
$table->string('file_type'); // 'quote' (devis), 'delivery_note' (bon de livraison), 'invoice' (facture)
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('attachments');
}
};