unsignedBigInteger('tenant_id')->nullable(false)->change(); $table->string('name', 50)->comment('역할명')->change(); $table->string('description', 255)->nullable()->comment('설명')->change(); // deleted_at 추가 (soft delete) $table->softDeletes()->comment('삭제일시(소프트삭제)'); }); // 2. (권장) 유니크 인덱스 보장: 한 테넌트 내에서 동일한 역할명 중복 불가 Schema::table('roles', function (Blueprint $table) { $table->unique(['tenant_id', 'name'], 'uk_roles_tenant_name'); }); } public function down(): void { Schema::table('roles', function (Blueprint $table) { // 롤백시 soft delete 및 인덱스 제거 $table->dropSoftDeletes(); $table->dropUnique('uk_roles_tenant_name'); }); } };