2017_05_30_203523_create_base_area_table.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 CreateBaseAreaTable extends Migration
  10. {
  11. /**
  12. * Run the migrations.
  13. *
  14. * @return void
  15. */
  16. public function up()
  17. {
  18. Schema::create('base_area', function (Blueprint $table) {
  19. $table->integer('id')->comment('编号');
  20. $table->char('name', 50)->comment('名称');
  21. $table->integer('pid')->comment('父级');
  22. $table->char('short_name', 50)->comment('简称');
  23. $table->tinyInteger('grade')->comment('层级关系');
  24. $table->smallInteger('city_code')->comment('区号');
  25. $table->integer('zip_code')->comment('邮编');
  26. $table->string('merger_name', 1024)->comment('关系值');
  27. $table->float('lng')->comment('精度');
  28. $table->float('lat')->comment('维度');
  29. $table->char('pinyin', 50)->comment('拼音');
  30. $table->timestamps();
  31. $table->softDeletes();
  32. $table->primary('id');
  33. $table->index('pid', 'idx_pid');
  34. $table->index('deleted_at', 'idx_deleted_at');
  35. });
  36. }
  37. /**
  38. * Reverse the migrations.
  39. *
  40. * @return void
  41. */
  42. public function down()
  43. {
  44. Schema::dropIfExists('base_area');
  45. }
  46. }