project-management/database/migrations/2022_05_03_075832_create_projects_table.php
2022-05-04 01:00:10 +08:00

41 lines
1.0 KiB
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.
*
* @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');
}
};