diff options
author | Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com> | 2024-11-05 11:03:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-05 11:03:59 +0100 |
commit | 24dba68daa6b22935eea214702976b0cd4c1fddd (patch) | |
tree | 0711578d822f33cb53380bdee46b34722531d84f | |
parent | f780eb4cd59c43c1f1dd94e2652adef1d8ffde0b (diff) | |
parent | 3f5770a78ba9ca4b8fec83fdefa8c85b3eba754a (diff) | |
download | nextcloud-server-24dba68daa6b22935eea214702976b0cd4c1fddd.tar.gz nextcloud-server-24dba68daa6b22935eea214702976b0cd4c1fddd.zip |
Merge pull request #49084 from nextcloud/backport/49076/stable28
-rw-r--r-- | lib/private/Repair/Owncloud/MigrateOauthTables.php | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/private/Repair/Owncloud/MigrateOauthTables.php b/lib/private/Repair/Owncloud/MigrateOauthTables.php index ae2b46e1949..8282db6bd0b 100644 --- a/lib/private/Repair/Owncloud/MigrateOauthTables.php +++ b/lib/private/Repair/Owncloud/MigrateOauthTables.php @@ -51,8 +51,7 @@ class MigrateOauthTables implements IRepairStep { return; } - $output->info("Update the oauth2_access_tokens table schema."); - $schema = new SchemaWrapper($this->db); + $output->info('Update the oauth2_access_tokens table schema.'); $table = $schema->getTable('oauth2_access_tokens'); if (!$table->hasColumn('hashed_code')) { $table->addColumn('hashed_code', 'string', [ @@ -73,8 +72,7 @@ class MigrateOauthTables implements IRepairStep { $table->addIndex(['client_id'], 'oauth2_access_client_id_idx'); } - $output->info("Update the oauth2_clients table schema."); - $schema = new SchemaWrapper($this->db); + $output->info('Update the oauth2_clients table schema.'); $table = $schema->getTable('oauth2_clients'); if ($table->getColumn('name')->getLength() !== 64) { // shorten existing values before resizing the column @@ -118,7 +116,8 @@ class MigrateOauthTables implements IRepairStep { $this->db->migrateToSchema($schema->getWrappedSchema()); - + // Regenerate schema after migrating to it + $schema = new SchemaWrapper($this->db); if ($schema->getTable('oauth2_clients')->hasColumn('identifier')) { $output->info("Move identifier column's data to the new client_identifier column."); // 1. Fetch all [id, identifier] couple. @@ -137,8 +136,7 @@ class MigrateOauthTables implements IRepairStep { ->executeStatement(); } - $output->info("Drop the identifier column."); - $schema = new SchemaWrapper($this->db); + $output->info('Drop the identifier column.'); $table = $schema->getTable('oauth2_clients'); $table->dropColumn('identifier'); $this->db->migrateToSchema($schema->getWrappedSchema()); |