12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?php
- use Illuminate\Support\Facades\Schema;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Database\Migrations\Migration;
- class CreateBaseDistrictTable extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('base_district', function (Blueprint $table) {
- $table->integer('id')->comment('编号');
- $table->char('name', 50)->comment('名称');
- $table->integer('pid')->comment('父级');
- $table->char('short_name', 50)->comment('简称');
- $table->tinyInteger('grade')->comment('层级关系');
- $table->smallInteger('city_code')->comment('区号');
- $table->integer('zip_code')->comment('邮编');
- $table->string('merger_name', 1024)->comment('关系值');
- $table->float('lng')->comment('精度');
- $table->float('lat')->comment('维度');
- $table->char('pinyin', 50)->comment('拼音');
- $table->timestamps();
- $table->softDeletes();
- $table->primary('id');
- $table->index('pid', 'idx_pid');
- $table->index('deleted_at', 'idx_deleted_at');
-
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('base_district');
- }
- }
|