/ database / migrations / 2021_10_08_084535_create_norm_resolution_table.php
2021_10_08_084535_create_norm_resolution_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 CreateNormResolutionTable extends Migration
 8  {
 9      /**
10       * Run the migrations.
11       *
12       * @return voidtodo
13       */
14      public function up()
15      {
16          Schema::create('norm_resolution', function (Blueprint $table) {
17              $table->id();
18              $table->timestamps();
19              $table->foreignId('norm_id')->nullable()->constrained('norms')->cascadeOnUpdate()->nullOnDelete();
20              $table->foreignId('resolution_id')->nullable()->constrained('resolutions')->cascadeOnUpdate()->nullOnDelete();
21              $table->unique(['norm_id', 'resolution_id']);
22          });
23      }
24  
25      /**
26       * Reverse the migrations.
27       *
28       * @return void
29       */
30      public function down()
31      {
32          Schema::dropIfExists('norm_resolution');
33      }
34  }