2020_04_03_150439_change_process_table.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class ChangeProcessTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::dropIfExists('processes');
  15. Schema::create('processes', function (Blueprint $table) {
  16. $table->bigIncrements('id');
  17. $table->string('code')->unique()->comment('任务号');
  18. $table->bigInteger('owner_id')->index()->comment('外键货主');
  19. $table->bigInteger('process_method_id')->comment('外键加工类型');
  20. $table->decimal('unit_price')->comment('单价');
  21. $table->enum('status',['待接单','待加工','驳回','加工中','待验收','已完成'])->comment('状态');
  22. $table->string('remark')->nullable()->comment('备注');
  23. $table->integer('amount')->comment('预期数量');
  24. $table->integer('completed_amount')->nullable()->comment('完成数量');
  25. $table->timestamp('created_at')->index()->nullable();
  26. $table->timestamp('updated_at')->nullable();
  27. });
  28. }
  29. /**
  30. * Reverse the migrations.
  31. *
  32. * @return void
  33. */
  34. public function down()
  35. {
  36. Schema::dropIfExists('processes');
  37. }
  38. }