2020_03_25_164030_create_processes_table.php 1.6 KB

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