Files
wetrack/database/migrations/2023_01_15_105105_create_tasks_table.php
2023-01-16 16:33:39 +08:00

47 lines
1.4 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateTasksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tasks', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('project_id');
$table->foreign('project_id')->references('id')->on('projects')->onDelete('cascade');
$table->string('summary');
$table->text('description');
$table->string('task_size');
$table->unsignedBigInteger('task_type_id');
$table->foreign('task_type_id')->references('id')->on('task_types')->onDelete('cascade');
$table->string('priority');
$table->string('status');
$table->unsignedInteger('story_points');
$table->unsignedBigInteger('assignee_id');
$table->foreign('assignee_id')->references('id')->on('users')->onDelete('cascade');
$table->unsignedBigInteger('parent_id')->nullable();
$table->foreign('parent_id')->references('id')->on('tasks')->onDelete('cascade');
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('tasks');
}
}