2021_06_07_100646_create_task_transactions_table.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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("fm_station_id")->nullable()->comment("来源库位");
  17. $table->string("to_station_id")->nullable()->comment("目标库位");
  18. $table->string("material_box_id")->nullable()->comment("料箱ID");
  19. $table->bigInteger("task_id")->nullable()->index()->comment("任务ID");
  20. $table->bigInteger("commodity_id")->nullable()->comment("商品ID");
  21. $table->integer("amount")->default(0)->comment("数量");
  22. $table->enum("type",["出库","入库","移库"])->comment("操作类型");
  23. $table->tinyInteger("status")->default(0)->comment("事务状态");
  24. $table->bigInteger("user_id")->nullable()->comment("操作人");
  25. $table->tinyInteger("mark")->default(0)->comment("标记类型");
  26. $table->timestamps();
  27. });
  28. }
  29. /**
  30. * Reverse the migrations.
  31. *
  32. * @return void
  33. */
  34. public function down()
  35. {
  36. Schema::dropIfExists('task_transactions');
  37. }
  38. }