2021_06_02_114506_change_storages_table.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class ChangeStoragesTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::dropIfExists('storages');
  15. Schema::create('storages', function (Blueprint $table) {
  16. $table->id();
  17. $table->bigInteger("station_id")->index()->comment("外键库位");
  18. $table->bigInteger("material_box_id")->nullable()->index()->comment("外键料箱");
  19. $table->bigInteger("commodity_id")->nullable()->index()->comment("外键商品");
  20. $table->integer("amount")->default(0)->comment("数量");
  21. $table->tinyInteger("status")->default(0)->comment("状态");
  22. $table->timestamps();
  23. });
  24. }
  25. /**
  26. * Reverse the migrations.
  27. *
  28. * @return void
  29. */
  30. public function down()
  31. {
  32. Schema::dropIfExists('storages');
  33. Schema::create('storages', function (Blueprint $table) {
  34. $table->id();
  35. $table->bigInteger("material_box_id")->index()->comment("外键料箱");
  36. $table->bigInteger("commodity_id")->nullable()->index()->comment("外键商品");
  37. $table->integer("amount")->default(0)->comment("数量");
  38. $table->timestamps();
  39. });
  40. }
  41. }