mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
Merge pull request #49076 from nextcloud/backport/49075/stable30
This commit is contained in:
commit
33f8caf274
1 changed files with 5 additions and 7 deletions
|
|
@ -36,8 +36,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', [
|
||||
|
|
@ -58,8 +57,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
|
||||
|
|
@ -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.
|
||||
|
|
@ -122,8 +121,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());
|
||||
|
|
|
|||
Loading…
Reference in a new issue