2020_03_25_164120_create_process_methods_table.php 939 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateProcessMethodsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * 二次加工类型
  11. *
  12. * @return void
  13. */
  14. public function up()
  15. {
  16. Schema::create('process_methods', function (Blueprint $table) {
  17. $table->bigIncrements('id');
  18. $table->string('name');
  19. $table->timestamps();
  20. });
  21. $processMethods=['贴标','撕标','全检','组套','拆套','喷码','其他'];
  22. for ($i=0;$i<count($processMethods);$i++){
  23. \App\ProcessMethod::create([
  24. 'name'=>$processMethods[$i]
  25. ]);
  26. }
  27. }
  28. /**
  29. * Reverse the migrations.
  30. *
  31. * @return void
  32. */
  33. public function down()
  34. {
  35. Schema::dropIfExists('process_methods');
  36. }
  37. }