applicant-site/database/migrations/2024_01_22_074748_create_do...

28 lines
762 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('documents', function (Blueprint $table) {
$table->id();
$table->string('name', 255)->unique();
$table->string('file_name')->nullable();
$table->text('description')->nullable();
$table->string('url', 255);
$table->smallInteger('position');
$table->foreignId('admission_id')->constrained('admissions');
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('documents');
}
};