2017_03_06_114416_modify_authentication_table.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class ModifyAuthenticationTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::table('authentications', function (Blueprint $table) {
  15. $table->smallInteger('province')->nullable()->after('real_name')->index();//居住省份
  16. $table->smallInteger('city')->nullable()->after('province')->index(); //居住城市
  17. $table->string('title')->nullable()->after('province'); //头衔
  18. $table->text('description')->nullable()->after('title'); //个人简介
  19. $table->tinyInteger('gender')->nullable()->after('description'); //性别: 1-男,2-女,0-保密
  20. });
  21. }
  22. /**
  23. * Reverse the migrations.
  24. *
  25. * @return void
  26. */
  27. public function down()
  28. {
  29. Schema::table('authentications', function (Blueprint $table) {
  30. $table->dropColumn(['province','city','title','description','gender']);
  31. });
  32. }
  33. }