2015_10_16_173405_create_areas_table.php 810 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateAreasTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('areas', function (Blueprint $table) {
  15. $table->increments('id')->unsigned(); //地区ID
  16. $table->string('name','64'); //地区名称
  17. $table->smallInteger('parent_id')->default(0); //父级ID
  18. $table->tinyInteger('grade'); //当前级别
  19. });
  20. }
  21. /**
  22. * Reverse the migrations.
  23. *
  24. * @return void
  25. */
  26. public function down()
  27. {
  28. Schema::drop('areas');
  29. }
  30. }