aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKate <26026535+provokateurin@users.noreply.github.com>2025-03-04 14:13:03 +0100
committerGitHub <noreply@github.com>2025-03-04 14:13:03 +0100
commitbeb12e9be3a3c235ab1552cc3f66f442820f19d6 (patch)
tree03f69486c7d2a9187e6dbd2b20f43e6ca7520cc8
parentacb1da5f724b64b5db17270318f9ab13fe34bcff (diff)
parenta572a5c515f566bd999bc0b05f733357ca714aae (diff)
downloadnextcloud-server-beb12e9be3a3c235ab1552cc3f66f442820f19d6.tar.gz
nextcloud-server-beb12e9be3a3c235ab1552cc3f66f442820f19d6.zip
Merge pull request #51221 from nextcloud/enh/noid/clean-migration-check-appconfig
feat(appconfig): removing pre-migration check
-rw-r--r--lib/private/AppConfig.php49
1 files changed, 7 insertions, 42 deletions
diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php
index f10684c4971..ad9299f01fd 100644
--- a/lib/private/AppConfig.php
+++ b/lib/private/AppConfig.php
@@ -62,16 +62,6 @@ class AppConfig implements IAppConfig {
/** @var array<array-key, array{entries: array<array-key, ConfigLexiconEntry>, strictness: ConfigLexiconStrictness}> ['app_id' => ['strictness' => ConfigLexiconStrictness, 'entries' => ['config_key' => ConfigLexiconEntry[]]] */
private array $configLexiconDetails = [];
- /**
- * $migrationCompleted is only needed to manage the previous structure
- * of the database during the upgrading process to nc29.
- *
- * only when upgrading from a version prior 28.0.2
- *
- * @TODO: remove this value in Nextcloud 30+
- */
- private bool $migrationCompleted = true;
-
public function __construct(
protected IDBConnection $connection,
protected LoggerInterface $logger,
@@ -1212,41 +1202,16 @@ class AppConfig implements IAppConfig {
$qb = $this->connection->getQueryBuilder();
$qb->from('appconfig');
- /**
- * The use of $this->migrationCompleted is only needed to manage the
- * database during the upgrading process to nc29.
- */
- if (!$this->migrationCompleted) {
- $qb->select('appid', 'configkey', 'configvalue');
- } else {
- // we only need value from lazy when loadConfig does not specify it
- $qb->select('appid', 'configkey', 'configvalue', 'type');
-
- if ($lazy !== null) {
- $qb->where($qb->expr()->eq('lazy', $qb->createNamedParameter($lazy ? 1 : 0, IQueryBuilder::PARAM_INT)));
- } else {
- $qb->addSelect('lazy');
- }
- }
-
- try {
- $result = $qb->executeQuery();
- } catch (DBException $e) {
- /**
- * in case of issue with field name, it means that migration is not completed.
- * Falling back to a request without select on lazy.
- * This whole try/catch and the migrationCompleted variable can be removed in NC30.
- */
- if ($e->getReason() !== DBException::REASON_INVALID_FIELD_NAME) {
- throw $e;
- }
-
- $this->migrationCompleted = false;
- $this->loadConfig($app, $lazy);
+ // we only need value from lazy when loadConfig does not specify it
+ $qb->select('appid', 'configkey', 'configvalue', 'type');
- return;
+ if ($lazy !== null) {
+ $qb->where($qb->expr()->eq('lazy', $qb->createNamedParameter($lazy ? 1 : 0, IQueryBuilder::PARAM_INT)));
+ } else {
+ $qb->addSelect('lazy');
}
+ $result = $qb->executeQuery();
$rows = $result->fetchAll();
foreach ($rows as $row) {
// most of the time, 'lazy' is not in the select because its value is already known