Files
BRISTO/database/migrations/2026_02_07_095425_create_documents_table.php
jeremy bayse 89a369964d Premier commit
2026-02-09 11:27:21 +01:00

35 lines
942 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('documents', function (Blueprint $table) {
$table->id();
$table->foreignId('contract_id')->constrained()->cascadeOnDelete();
$table->string('filename');
$table->string('path');
$table->string('mime_type')->nullable();
$table->integer('size')->nullable();
$table->text('description')->nullable();
$table->foreignId('uploaded_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('documents');
}
};