2020_04_04_141214_create_switch_table.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateSwitchTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('switch', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->string('name', 255)->default('')->comment('name');
  17. $table->tinyInteger('status')->default(1)->comment('status: 1-open;0-close');
  18. $table->longText('extra')->nullable()->comment('extra setting');
  19. $table->integer('updated_at');
  20. $table->integer('created_at');
  21. $table->integer('deleted_at')->nullable();
  22. // $table->index('site_title');
  23. $table->index('name');
  24. });
  25. }
  26. /**
  27. * Reverse the migrations.
  28. *
  29. * @return void
  30. */
  31. public function down()
  32. {
  33. Schema::dropIfExists('switch');
  34. }
  35. }