| Total Complexity | 2 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | return new class extends Migration |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Run the migrations. |
||
| 11 | */ |
||
| 12 | public function up(): void |
||
| 13 | { |
||
| 14 | Schema::create('regions', function (Blueprint $table) { |
||
| 15 | $table->id(); |
||
| 16 | $table->string('name')->comment('社区名称'); |
||
| 17 | $table->string('city_code')->comment("城市代码"); |
||
| 18 | $table->string('city')->comment("城市名称"); |
||
| 19 | $table->string('province_code')->comment("省份名称"); |
||
| 20 | $table->string('province')->comment("省份名称"); |
||
| 21 | $table->string('county_code')->comment("县区名称"); |
||
| 22 | $table->string('county')->comment("县区名称"); |
||
| 23 | $table->string('address')->comment("地址"); |
||
| 24 | $table->geography('geo', subtype: 'point')->comment("地理信息"); |
||
| 25 | $table->string('model_id')->index()->nullable()->comment("模型ID"); |
||
| 26 | $table->string('model_type')->index()->nullable()->comment('关联类'); |
||
| 27 | $table->timestamps(); |
||
| 28 | $table->comment("地理信息储存表"); |
||
| 29 | }); |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Reverse the migrations. |
||
| 34 | */ |
||
| 35 | public function down(): void |
||
| 38 | } |
||
| 39 | }; |
||
| 40 |