/ database / migrations / 2021_07_29_075014_create_taxonomy_task_table.php
2021_07_29_075014_create_taxonomy_task_table.php
 1  <?php
 2  
 3  use Illuminate\Database\Migrations\Migration;
 4  use Illuminate\Database\Schema\Blueprint;
 5  use Illuminate\Support\Facades\Schema;
 6  
 7  class CreateTaxonomyTaskTable extends Migration
 8  {
 9      /**
10       * Run the migrations.
11       *
12       * @return void
13       */
14      public function up()
15      {
16          Schema::create('taxonomy_tasks', function (Blueprint $table) {
17              $table->id();
18              $table->string('title')->unique();
19              $table->string('description');
20              $table->boolean('is_milestone')->default(false);
21              $table->foreignId('taxonomy_stage_id')->nullable()->constrained('taxonomy_stages')->cascadeOnUpdate()->nullOnDelete();
22  
23              $table->timestamps();
24              $table->softDeletes();
25          });
26      }
27  
28      /**
29       * Reverse the migrations.
30       *
31       * @return void
32       */
33      public function down()
34      {
35          Schema::dropIfExists('TaxonomyTask');
36      }
37  }