2021_07_08_114111_create_dossier_statuses_table.php
1 <?php 2 3 use Illuminate\Database\Migrations\Migration; 4 use Illuminate\Database\Schema\Blueprint; 5 use Illuminate\Support\Facades\DB; 6 use Illuminate\Support\Facades\Schema; 7 8 class CreateDossierStatusesTable extends Migration 9 { 10 /** 11 * Run the migrations. 12 * 13 * @return void 14 */ 15 public function up() 16 { 17 Schema::create('dossier_statuses', function (Blueprint $table) { 18 $table->id(); 19 $table->string('name')->unique(); 20 $table->timestamps(); 21 $table->softDeletes(); 22 }); 23 24 DB::table('dossier_statuses')->insert([ 25 [ 26 'id' => 1, 27 'name' => 'PENDING', 28 ], 29 [ 30 'id' => 2, 31 'name' => 'IN_PROCESS', 32 ], 33 [ 34 'id' => 3, 35 'name' => 'FINISHED', 36 ], 37 ]); 38 } 39 40 /** 41 * Reverse the migrations. 42 * 43 * @return void 44 */ 45 public function down() 46 { 47 Schema::dropIfExists('dossier_statuses'); 48 } 49 }