<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddTachesProjets extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('taches_gestion_projet', function ($table) {
            $table->id();
            $table->unsignedInteger('projet_id');
            $table->string('nom');
            $table->string('description')->nullable();
            $table->unsignedInteger('responsable_id');
            $table->date('date_debut');
            $table->date('date_fin');
            $table->double('nb_jours', 6, 2);
            $table->timestamps();

            $table->foreign('projet_id')->references('id')->on('projets');
            $table->foreign('responsable_id')->references('id')->on('users');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
