2019_09_17_151927_create_table_startup.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateTableStartup extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('startup', function (Blueprint $table) {
  15. $table->bigIncrements('id');
  16. $table->string('title', 32)
  17. ->default('')
  18. ->comment('标题');
  19. $table->tinyInteger('is_open')
  20. ->default(0)
  21. ->comment('是否开启:0否,1是');
  22. $table->string('img', 255)
  23. ->default('')
  24. ->comment('图片');
  25. $table->string('url', 255)
  26. ->default('')
  27. ->comment('跳转地址');
  28. $table->softDeletes();
  29. $table->timestamps();
  30. });
  31. }
  32. /**
  33. * Reverse the migrations.
  34. *
  35. * @return void
  36. */
  37. public function down()
  38. {
  39. Schema::dropIfExists('startup');
  40. }
  41. }