<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('projects', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('client_id')->nullable(false);
            $table->unsignedBigInteger('parent_project_id')->nullable(true);
            $table->unsignedTinyInteger('status')->nullable(false);
            $table->string('title')->nullable(false);
            $table->text('description')->nullable(true);
            $table->date('begin_at')->nullable(true);
            $table->date('end_at')->nullable(true);
            $table->integer('price')->nullable(false);
            $table->timestamps();
        });

    }

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