2017_05_30_203524_create_base_settings_table.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. /**
  6. * Migration auto-generated by Sequel Pro Laravel Export
  7. * @see https://github.com/cviebrock/sequel-pro-laravel-export
  8. */
  9. class CreateBaseSettingsTable extends Migration
  10. {
  11. /**
  12. * Run the migrations.
  13. *
  14. * @return void
  15. */
  16. public function up()
  17. {
  18. Schema::create('base_settings', function (Blueprint $table) {
  19. $table->increments('id');
  20. $table->string('key', 50)->comment('配置代码');
  21. $table->text('value')->comment('配置名称');
  22. $table->unsignedInteger('sort')->comment('排序');
  23. $table->string('category', 50)->comment('配置类型');
  24. $table->unsignedInteger('pid')->comment('父id');
  25. $table->tinyInteger('status')->default(1)->comment('图片状态');
  26. $table->timestamps();
  27. $table->softDeletes();
  28. $table->index('category', 'idx_category');
  29. $table->index('key', 'idx_code');
  30. $table->index('pid', 'idx_pid');
  31. });
  32. DB::update("ALTER TABLE base_settings AUTO_INCREMENT = 1000;");
  33. }
  34. /**
  35. * Reverse the migrations.
  36. *
  37. * @return void
  38. */
  39. public function down()
  40. {
  41. Schema::dropIfExists('base_settings');
  42. }
  43. }