config = $config; $this->connection = $connection; } public function getName(): string { return 'Reset generated avatar flag'; } private function shouldRun(): bool { $versionFromBeforeUpdate = $this->config->getSystemValueString('version', '0.0.0.0'); return version_compare($versionFromBeforeUpdate, '18.0.0.5', '<='); } public function run(IOutput $output): void { if ($this->shouldRun()) { $query = $this->connection->getQueryBuilder(); $query->delete('preferences') ->where($query->expr()->eq('appid', $query->createNamedParameter('avatar'))) ->andWhere($query->expr()->eq('configkey', $query->createNamedParameter('generated'))); } } }