<?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('sprints_criterias', function (Blueprint $table) {
            $table->unsignedBigInteger('sprint_id');
            $table->unsignedBigInteger('criteria_id');
            $table->integer('point');
            $table->string('expect_result');
            $table->string('actual_result');
            $table->string('note')->nullable();
            $table->string('created_by');
            $table->timestamps();
            
            $table->foreign('sprint_id')->references('id')->on('sprint')->onDelete('cascade');
            $table->foreign('criteria_id')->references('id')->on('criterias')->onDelete('cascade');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('sprints_criterias');
    }
};
