2021_06_07_100646_create_task_transactions_table.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateTaskTransactionsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('task_transactions', function (Blueprint $table) {
  15. $table->id();
  16. $table->string("doc_code")->nullable()->comment("文档代码");
  17. $table->string("bar_code")->nullable()->comment("商品条码");
  18. $table->string("fm_station_id")->nullable()->comment("来源库位");
  19. $table->string("to_station_id")->nullable()->comment("目标库位");
  20. $table->string("material_box_id")->nullable()->comment("料箱ID");
  21. $table->bigInteger("task_id")->nullable()->index()->comment("任务ID");
  22. $table->bigInteger("commodity_id")->nullable()->comment("商品ID");
  23. $table->integer("amount")->default(0)->comment("数量");
  24. $table->enum("type",["出库","入库","移库"])->comment("操作类型");
  25. $table->tinyInteger("status")->default(0)->comment("事务状态");
  26. $table->bigInteger("user_id")->nullable()->comment("操作人");
  27. $table->tinyInteger("mark")->default(0)->comment("标记类型");
  28. $table->timestamps();
  29. });
  30. }
  31. /**
  32. * Reverse the migrations.
  33. *
  34. * @return void
  35. */
  36. public function down()
  37. {
  38. Schema::dropIfExists('task_transactions');
  39. }
  40. }