2022_07_15_034921_create_regions_table.php 964 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateRegionsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('regions', function (Blueprint $table) {
  15. $table->integer('id')->comment('编号');
  16. $table->integer('code')->comment('地区代码');
  17. $table->integer('parent_code')->comment('父级');
  18. $table->tinyInteger('type')->comment('类型:1省,2市,3区');
  19. $table->string('name', 32)->comment('名称');
  20. $table->string('full_name', 32)->comment('全名');
  21. //$table->index('code', 'parent_code', 'type');
  22. });
  23. }
  24. /**
  25. * Reverse the migrations.
  26. *
  27. * @return void
  28. */
  29. public function down()
  30. {
  31. Schema::dropIfExists('regions');
  32. }
  33. }