2017_11_16_144603_create_traces_table.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateTracesTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('traces', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->string('key')->comment('单元识别码');
  17. $table->string('group')->nullable()->comment('分组标记');
  18. $table->integer('gid')->default(0)->comment('物品id');
  19. $table->timestamp('look_time')->nullable()->comment('查看时间');
  20. $table->integer('look_count')->default(0)->comment('查看的次数');
  21. $table->integer('dealer_id')->default(0)->comment('经销商id');
  22. $table->integer('product_id')->default(0)->comment('产品id');
  23. $table->text('remark')->nullable()->comment('备注');
  24. $table->string('slug')->nullable()->comment('key');
  25. $table->tinyInteger('status')->default(1)->comment('状态');
  26. $table->timestamps();
  27. $table->unique('key');
  28. });
  29. }
  30. /**
  31. * Reverse the migrations.
  32. *
  33. * @return void
  34. */
  35. public function down()
  36. {
  37. Schema::dropIfExists('traces');
  38. }
  39. }