diff options
author | Joas Schilling <coding@schilljs.com> | 2024-11-04 14:16:40 +0100 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2024-11-04 20:36:20 +0000 |
commit | 6a912e7afcd349f10e7a2bdc72b2c1f6336ac6c8 (patch) | |
tree | 4d6cd21de2f0aaf4262fb5a8aab505894d996859 | |
parent | 12f24edba8e0afad5d7a780ba2c1bb41d4b3520f (diff) | |
download | nextcloud-server-backport/49076/stable29.tar.gz nextcloud-server-backport/49076/stable29.zip |
fix(owncloud): Fix ownCloud migration with oauth2 appbackport/49076/stable29
Signed-off-by: Joas Schilling <coding@schilljs.com>
-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()); |