schema(false)); MigrationHelper::createTable('user_histories', $this->schema(true)); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('users'); Schema::dropIfExists('user_histories'); } private function schema(bool $forHistory) { return function (Blueprint $table, MigrationHelper $helper) use ($forHistory) { $helper->baseColumn() ->contractId(true); $table->string('email')->comment("Email")->nullable(); $table->string('password')->comment("ログインパスワード")->nullable(); $table->unsignedTinyInteger("role")->comment("認可")->nullable(); $table->string('name')->comment("氏名")->nullable(); $helper->index(1, [ColumnName::CONTRACT_ID]); $helper->index(2, ['email']); }; } };