2019_05_08_160636_create_districts_table.php 793 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. class CreateDistrictsTable extends Migration {
  5. /**
  6. * Run the migrations.
  7. *
  8. * @return void
  9. */
  10. public function up()
  11. {
  12. Schema::create('districts', function(Blueprint $table)
  13. {
  14. $table->increments('id');
  15. $table->string('adcode', 191)->comment('行政编码');
  16. $table->string('name', 191)->comment('名字');
  17. $table->string('center', 191)->comment('经纬度');
  18. $table->string('level', 191)->comment('级别');
  19. $table->integer('parent_id')->default(0);
  20. $table->integer('sort')->default(0)->comment('排序');
  21. $table->timestamps();
  22. });
  23. }
  24. /**
  25. * Reverse the migrations.
  26. *
  27. * @return void
  28. */
  29. public function down()
  30. {
  31. Schema::drop('districts');
  32. }
  33. }