2020_03_09_153510_create_stores_table.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateStoresTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('stores', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->bigInteger('id_owner')->index();
  17. $table->string('asn_code')->nullable()->unique()->comment('WMS的ASNNO单号');
  18. $table->integer('warehouse_id')->nullable()->comment('仓库ID');
  19. $table->integer('owner_id')->index()->nullable()->comment('货主ID');
  20. $table->enum('stored_method',['正常','快速入库'])->default('正常');
  21. $table->enum('status',['无需入库','已入库','未入库','待推单'])->nullable();
  22. $table->string('remark')->nullable();
  23. $table->timestamp('deleted_at')->nullable()->index();
  24. $table->timestamp('updated_at')->nullable();
  25. $table->timestamp('created_at')->nullable()->index();
  26. });
  27. }
  28. /**
  29. * Reverse the migrations.
  30. *
  31. * @return void
  32. */
  33. public function down()
  34. {
  35. Schema::dropIfExists('stores');
  36. }
  37. }