2021_06_07_084531_create_norms_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 CreateNormsTable extends Migration 8 { 9 /** 10 * Run the migrations. 11 * 12 * @return void 13 */ 14 public function up() 15 { 16 Schema::create('norms', function (Blueprint $table) { 17 $table->id(); 18 $table->string('version'); 19 $table->string('description'); 20 $table->foreignId('norm_group_id') 21 ->nullable() 22 ->constrained('norm_groups') 23 ->cascadeOnUpdate() 24 ->nullOnDelete(); 25 $table->integer('oracle_code')->nullable(); 26 $table->timestamps(); 27 $table->softDeletes(); 28 }); 29 } 30 31 /** 32 * Reverse the migrations. 33 * 34 * @return void 35 */ 36 public function down() 37 { 38 Schema::dropIfExists('norms'); 39 } 40 }