12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- class CreateAdminsTable extends Migration
- {
- /**
- * Run the migrations.
- *
- * @return void
- */
- public function up()
- {
- Schema::create('admins', function (Blueprint $table) {
- $table->id();
- $table->string('username', 120)->unique()->comment('账户');
- $table->string('password', 80);
- $table->string('name')->comment('昵称');
- $table->string('headimg')->nullable();
- $table->string('remember_token', 100)->nullable();
- $table->tinyInteger('type')->default(0)->comment('类型:0:管理员;1:老师;2:学生');
- $table->integer('type_id')->default(0)->comment('类型id');
- $table->integer('department_id')->default(0)->comment('部门id');
- $table->tinyInteger('status')->default(1);
- $table->softDeletes();
- $table->timestamps();
- });
- }
- /**
- * Reverse the migrations.
- *
- * @return void
- */
- public function down()
- {
- Schema::dropIfExists('admins');
- }
- }
|