step 1, 2 and 3 of the implementation plan
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
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('session_id')->constrained('questionnaire_sessions')->cascadeOnDelete();
|
||||
$table->foreignId('question_id')->constrained()->cascadeOnDelete();
|
||||
$table->string('value', 255)->nullable();
|
||||
$table->text('text_value')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['session_id', 'question_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('answers');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user