2018_09_27_053424_create_configs_table.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateConfigsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('configs', function (Blueprint $table) {
  15. $table->increments('id');
  16. $table->unsignedInteger('type_id')->index()->comment('config_types.id');
  17. $table->string('name')->index()->comment('配置名称');
  18. $table->string('alias')->index()->comment('别名');
  19. $table->text('value')->comment('配置值');
  20. $table->unsignedInteger('listorder')->comment('排序');
  21. $table->string('input_type')->comment('输入框类型:同admin的form组件');
  22. $table->string('default_values')->comment('默认值');
  23. $table->string('option_values')->comment('提供的选择项:json对象{"name":"value"}');
  24. $table->string('tips')->comment('提示信息');
  25. $table->string('placeholder')->comment('placeholder');
  26. $table->string('rules')->comment('验证规则');
  27. $table->string('rule_messages')->comment('验证错误信息,json对象');
  28. $table->string('def_value')->comment('配置选项默认值');
  29. $table->tinyInteger('input_type')->comment('输入框类型');
  30. $table->tinyInteger('type')->index()->comment('类型(1:配置 2: 注册配置 3:电子地图 4:注册协议 5:积分配置 6:首页底部 7:其他 8:关键词过滤 9:职位层级)');
  31. $table->timestamps();
  32. $table->softDeletes();
  33. });
  34. }
  35. /**
  36. * Reverse the migrations.
  37. *
  38. * @return void
  39. */
  40. public function down()
  41. {
  42. Schema::dropIfExists('configs');
  43. }
  44. }