mirror of
https://gitlab.com/izyim/wetrack.git
synced 2026-08-19 04:23:57 +00:00
47 lines
1.4 KiB
PHP
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');
|
|
}
|
|
}
|