2017_09_18_013946_create_template_info_table.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateTemplateInfoTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('template_info', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->integer('class_id')->comment('所属分类');
  17. $table->string('name')->comment('小程序名');
  18. $table->string('show')->comment('展示图片');
  19. $table->integer('price')->comment('售价');
  20. $table->integer('designer_id')->default(0)->comment('设计师');
  21. $table->char('phone', 11)->comment('联系方式');
  22. $table->integer('sort')->default(0)->comment('排序号');
  23. $table->text('pic')->comment('展示截图');
  24. $table->text('desc')->comment('简介');
  25. $table->timestamps();
  26. $table->index('class_id');
  27. $table->index('designer_id');
  28. $table->softDeletes();
  29. });
  30. }
  31. /**
  32. * Reverse the migrations.
  33. *
  34. * @return void
  35. */
  36. public function down()
  37. {
  38. Schema::dropIfExists('template_info');
  39. }
  40. }