]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(db): Use `createSchemaManager()` method as `getSchemaManager()` is deprecated
authorJoas Schilling <coding@schilljs.com>
Fri, 28 Jun 2024 13:55:02 +0000 (15:55 +0200)
committerJoas Schilling <coding@schilljs.com>
Fri, 19 Jul 2024 09:21:11 +0000 (11:21 +0200)
Signed-off-by: Joas Schilling <coding@schilljs.com>
core/Command/Db/ConvertType.php
lib/private/DB/Connection.php
lib/private/DB/OracleConnection.php
lib/private/DB/PgSqlTools.php
tests/lib/Repair/RepairCollationTest.php

index 333f29625f62fa39c8739971aa39a57a530c6864..592285a8309d47f90e34446668809cd5a89a9d5a 100644 (file)
@@ -245,7 +245,7 @@ class ConvertType extends Command implements CompletionAwareInterface {
                        $output->writeln('<info>Clearing schema in new database</info>');
                }
                foreach ($toTables as $table) {
-                       $db->getSchemaManager()->dropTable($table);
+                       $db->createSchemaManager()->dropTable($table);
                }
        }
 
@@ -258,7 +258,7 @@ class ConvertType extends Command implements CompletionAwareInterface {
                        }
                        return preg_match($filterExpression, $asset) !== false;
                });
-               return $db->getSchemaManager()->listTableNames();
+               return $db->createSchemaManager()->listTableNames();
        }
 
        /**
index c886cb202353f6e96ada58e011e776ff1f6adb17..fb5729c678cfdce44e28f426a9fe383bd2e0cfa7 100644 (file)
@@ -561,7 +561,7 @@ class Connection extends PrimaryReadReplicaConnection {
         */
        public function dropTable($table) {
                $table = $this->tablePrefix . trim($table);
-               $schema = $this->getSchemaManager();
+               $schema = $this->createSchemaManager();
                if ($schema->tablesExist([$table])) {
                        $schema->dropTable($table);
                }
@@ -577,7 +577,7 @@ class Connection extends PrimaryReadReplicaConnection {
         */
        public function tableExists($table) {
                $table = $this->tablePrefix . trim($table);
-               $schema = $this->getSchemaManager();
+               $schema = $this->createSchemaManager();
                return $schema->tablesExist([$table]);
        }
 
index abfb69f129b9f05e4188069b0ce995ee6a0fcfa5..5ffb65d801dbe3b02c2529436173291c6ec93073 100644 (file)
@@ -68,7 +68,7 @@ class OracleConnection extends Connection {
        public function dropTable($table) {
                $table = $this->tablePrefix . trim($table);
                $table = $this->quoteIdentifier($table);
-               $schema = $this->getSchemaManager();
+               $schema = $this->createSchemaManager();
                if ($schema->tablesExist([$table])) {
                        $schema->dropTable($table);
                }
@@ -83,7 +83,7 @@ class OracleConnection extends Connection {
        public function tableExists($table) {
                $table = $this->tablePrefix . trim($table);
                $table = $this->quoteIdentifier($table);
-               $schema = $this->getSchemaManager();
+               $schema = $this->createSchemaManager();
                return $schema->tablesExist([$table]);
        }
 }
index 35e8016191c74ce1c72bff9efba1c75fd0ed9f57..d529cb26b09d53cf757ef107dcbabffa78fa738b 100644 (file)
@@ -43,7 +43,7 @@ class PgSqlTools {
                        return preg_match($filterExpression, $asset) !== false;
                });
 
-               foreach ($conn->getSchemaManager()->listSequences() as $sequence) {
+               foreach ($conn->createSchemaManager()->listSequences() as $sequence) {
                        $sequenceName = $sequence->getName();
                        $sqlInfo = 'SELECT table_schema, table_name, column_name
                                FROM information_schema.columns
index 55bda8337c978520dcba15161482edb14a9abb92..5f5e0737f77bd17ab6dd36d9d878db22253f0a22 100644 (file)
@@ -73,7 +73,7 @@ class RepairCollationTest extends TestCase {
        }
 
        protected function tearDown(): void {
-               $this->connection->getInner()->getSchemaManager()->dropTable($this->tableName);
+               $this->connection->getInner()->createSchemaManager()->dropTable($this->tableName);
                parent::tearDown();
        }