diff options
author | Joas Schilling <coding@schilljs.com> | 2024-11-04 14:16:40 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2024-11-04 14:16:40 +0100 |
commit | 015835f4e7d20e06beca8944806f01998b1dd55d (patch) | |
tree | 21d911e104638562515cb46abd7a9b9a37ae1131 /lib/private | |
parent | bd8348f5c1ab1732de02ccff8fefd8919ba2a8fd (diff) | |
download | nextcloud-server-015835f4e7d20e06beca8944806f01998b1dd55d.tar.gz nextcloud-server-015835f4e7d20e06beca8944806f01998b1dd55d.zip |
fix(owncloud): Fix ownCloud migration with oauth2 appbugfix/noid/fix-oauth2-owncloud-migration
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Repair/Owncloud/MigrateOauthTables.php | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/private/Repair/Owncloud/MigrateOauthTables.php b/lib/private/Repair/Owncloud/MigrateOauthTables.php index 94ec0eba3e6..02f89db6c24 100644 --- a/lib/private/Repair/Owncloud/MigrateOauthTables.php +++ b/lib/private/Repair/Owncloud/MigrateOauthTables.php @@ -37,7 +37,6 @@ class MigrateOauthTables implements IRepairStep { } $output->info('Update the oauth2_access_tokens table schema.'); - $schema = new SchemaWrapper($this->db); $table = $schema->getTable('oauth2_access_tokens'); if (!$table->hasColumn('hashed_code')) { $table->addColumn('hashed_code', 'string', [ @@ -59,7 +58,6 @@ class MigrateOauthTables implements IRepairStep { } $output->info('Update the oauth2_clients table schema.'); - $schema = new SchemaWrapper($this->db); $table = $schema->getTable('oauth2_clients'); if ($table->getColumn('name')->getLength() !== 64) { // shorten existing values before resizing the column @@ -103,7 +101,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. @@ -123,7 +122,6 @@ class MigrateOauthTables implements IRepairStep { } $output->info('Drop the identifier column.'); - $schema = new SchemaWrapper($this->db); $table = $schema->getTable('oauth2_clients'); $table->dropColumn('identifier'); $this->db->migrateToSchema($schema->getWrappedSchema()); |