2014_10_12_000000_create_users_table.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('users', function (Blueprint $table) {
  15. $table->increments('id')->unsigned(); //用户UID
  16. $table->string('name')->index(); //姓名
  17. $table->string('email',128)->index()->nullable(); //登录邮箱
  18. $table->string('mobile',24)->index()->nullable(); //登录手机
  19. $table->string('password', 64); //登录密码
  20. $table->tinyInteger('gender')->nullable(); //性别: 1-男,2-女,0-保密
  21. $table->date('birthday')->nullable(); //出生日期
  22. $table->smallInteger('province')->nullable(); //居住省份
  23. $table->smallInteger('city')->nullable(); //居住城市
  24. $table->string('title')->nullable(); //头衔
  25. $table->text('description')->nullable(); //个人简介
  26. $table->tinyInteger('status')->default(1); //用户状态0-待审核,1已审核
  27. $table->string('site_notifications')->nullable(); //站内通知
  28. $table->string('email_notifications')->nullable(); //邮件通知策略
  29. $table->rememberToken(); //记住登录状态
  30. $table->timestamps(); //注册时间,上次更新时间
  31. });
  32. }
  33. /**
  34. * Reverse the migrations.
  35. *
  36. * @return void
  37. */
  38. public function down()
  39. {
  40. Schema::drop('users');
  41. }
  42. }