Files
RecruIT/database/migrations/2026_03_19_091306_create_answers_table.php
jeremy bayse a55a33ae2a Initial commit
2026-03-20 08:25:58 +01:00

32 lines
840 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('answers', function (Blueprint $table) {
$table->id();
$table->foreignId('attempt_id')->constrained()->onDelete('cascade');
$table->foreignId('question_id')->constrained()->onDelete('cascade');
$table->foreignId('option_id')->nullable()->constrained()->onDelete('cascade');
$table->text('text_content')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('answers');
}
};