/ database / migrations / 2021_10_07_083052_create_resolutions_table.php
2021_10_07_083052_create_resolutions_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 CreateResolutionsTable extends Migration
 8  {
 9      /**
10       * Run the migrations.
11       *
12       * @return void
13       */
14      public function up()
15      {
16          Schema::create('resolutions', function (Blueprint $table) {
17              $table->id();
18              $table->timestamps();
19              $table->string('code_year')->index();
20              $table->string('code_seq')->index();
21              $table->boolean('approved')->default(false)->index();
22              $table->timestamp('resolution_date')->nullable()->index();
23              $table->foreignId('dossier_id')->constrained('dossiers')->cascadeOnDelete();
24              $table->foreignId('infor_cert_id')->nullable()->constrained('revisions');
25              $table->foreignId('resolved_doc_id')->nullable()->constrained('revisions');
26              /* $table->string('resolved_doc'); */
27          });
28      }
29  
30      /**
31       * Reverse the migrations.
32       *
33       * @return void
34       */
35      public function down()
36      {
37          Schema::dropIfExists('resolutions');
38      }
39  }