2020_06_05_165357_create_pre_users_table.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreatePreUsersTable 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. {
  16. $table->increments('id');
  17. $table->string('identity')->nullable()->default('')->comment('身份');
  18. $table->string('token', 100)->nullable()->default('')->index('IDEX_token');
  19. $table->string('username', 100)->nullable()->default('')->unique('IDEX_username')->comment('用户名');
  20. $table->string('nickname')->nullable()->comment('昵称');
  21. $table->string('userimg')->nullable()->default('')->comment('已审核头像');
  22. $table->string('profession')->nullable()->default('')->comment('职称/职位');
  23. $table->string('encrypt', 50)->nullable()->default('');
  24. $table->string('userpass', 50)->nullable()->default('')->comment('登录密码');
  25. $table->integer('wsid')->nullable()->default(0)->index('IDEX_wsid')->comment('websocket');
  26. $table->bigInteger('wsdate')->nullable()->default(0)->index('IDEX_wsdate')->comment('websocket最后刷新时间');
  27. $table->integer('bgid')->nullable()->default(0)->comment('背景ID');
  28. $table->integer('loginnum')->nullable()->default(0)->comment('累计登陆次数');
  29. $table->string('lastip', 20)->nullable()->default('')->comment('最后登录IP');
  30. $table->bigInteger('lastdate')->nullable()->default(0)->comment('最后登录时间');
  31. $table->string('lineip', 20)->nullable()->default('')->index('IDEX_lineip')->comment('最后在线IP(接口)');
  32. $table->bigInteger('linedate')->nullable()->default(0)->comment('最后在线时间(接口)');
  33. $table->string('regip', 20)->nullable()->default('')->comment('注册IP');
  34. $table->bigInteger('regdate')->nullable()->default(0)->comment('注册时间');
  35. $table->text('setting')->nullable();
  36. });
  37. }
  38. /**
  39. * Reverse the migrations.
  40. *
  41. * @return void
  42. */
  43. public function down()
  44. {
  45. Schema::drop('users');
  46. }
  47. }