2021_08_11_143815_create_admins_table.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. use Illuminate\Database\Migrations\Migration;
  3. use Illuminate\Database\Schema\Blueprint;
  4. use Illuminate\Support\Facades\Schema;
  5. class CreateAdminsTable extends Migration
  6. {
  7. /**
  8. * Run the migrations.
  9. *
  10. * @return void
  11. */
  12. public function up()
  13. {
  14. Schema::create('admins', function (Blueprint $table) {
  15. $table->id();
  16. $table->string('username', 120)->unique()->comment('账户');
  17. $table->string('password', 80);
  18. $table->string('name')->comment('昵称');
  19. $table->string('headimg')->nullable();
  20. $table->string('remember_token', 100)->nullable();
  21. $table->tinyInteger('type')->default(0)->comment('类型:0:管理员;1:老师;2:学生');
  22. $table->integer('type_id')->default(0)->comment('类型id');
  23. $table->integer('department_id')->default(0)->comment('部门id');
  24. $table->tinyInteger('status')->default(1);
  25. $table->softDeletes();
  26. $table->timestamps();
  27. });
  28. }
  29. /**
  30. * Reverse the migrations.
  31. *
  32. * @return void
  33. */
  34. public function down()
  35. {
  36. Schema::dropIfExists('admins');
  37. }
  38. }