2017_05_30_203524_create_base_dictionary_table.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 CreateBaseDictionaryTable extends Migration
  10. {
  11. /**
  12. * Run the migrations.
  13. *
  14. * @return void
  15. */
  16. public function up()
  17. {
  18. Schema::create('base_dictionary', function (Blueprint $table) {
  19. $table->increments('id');
  20. $table->string('dictionary_table_code', 32)->comment('数据字典表');
  21. $table->string('dictionary_code', 32)->comment('数据字典代码');
  22. $table->string('key', 21)->comment('程序中使用,数据库使用value');
  23. $table->string('value', 32)->comment('编码');
  24. $table->string('name', 256)->comment('名称');
  25. $table->string('input_code', 256)->comment('输入码,通常用于保留拼音');
  26. $table->integer('sort')->comment('排序');
  27. $table->timestamps();
  28. $table->softDeletes();
  29. $table->index(['dictionary_table_code', 'dictionary_code'], 'idx_table_code');
  30. $table->index('deleted_at', 'idx_deleted_at');
  31. });
  32. }
  33. /**
  34. * Reverse the migrations.
  35. *
  36. * @return void
  37. */
  38. public function down()
  39. {
  40. Schema::dropIfExists('base_dictionary_option');
  41. }
  42. }