2014_10_12_000000_create_users_table.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. use Illuminate\Support\Facades\Schema;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Database\Migrations\Migration;
  5. class CreateUsersTable extends Migration
  6. {
  7. protected $table = TABLE_USERS;
  8. /**
  9. * Run the migrations.
  10. *
  11. * @return void
  12. */
  13. public function up()
  14. {
  15. Schema::create($this->table, function (Blueprint $table) {
  16. $table->increments('id')->comment('唯一标识')->unsigned();
  17. $table->char('uuid', 128)->comment('对外唯一标识');
  18. $table->string('name', 25)->comment('昵称')->unique();
  19. $table->char('sex', 1)->comment('性别,M-男,F-女')->nullable();
  20. $table->string('mobile', 11)->comment('手机号码');
  21. $table->string('email', 50)->comment('电子邮箱')->nullable();
  22. $table->string('password')->comment('密码');
  23. $table->dateTime('last_time')->comment('最近登录时间')->nullable();
  24. $table->string('remark', 50)->comment('备注')->nullable();
  25. $table->rememberToken();
  26. $table->timestamps();
  27. });
  28. DB::statement("ALTER TABLE ".$this->table." comment'会员基本信息表'");
  29. }
  30. /**
  31. * Reverse the migrations.
  32. *
  33. * @return void
  34. */
  35. public function down()
  36. {
  37. Schema::dropIfExists($this->table);
  38. }
  39. }