summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorLouis <6653109+artonge@users.noreply.github.com>2022-03-28 11:14:49 +0200
committerGitHub <noreply@github.com>2022-03-28 11:14:49 +0200
commit9db75dbe5afbe90a9161de0bdee55dc71d97c480 (patch)
tree9ee8b9e695a403c4cc35b32f6334ee6312b90bfa /apps
parent53180f40e15b92cd4953d0c13c5451a07fe559ca (diff)
parentc5722869be32ced505d71b11f5e1ea8e169aae57 (diff)
downloadnextcloud-server-9db75dbe5afbe90a9161de0bdee55dc71d97c480.tar.gz
nextcloud-server-9db75dbe5afbe90a9161de0bdee55dc71d97c480.zip
Merge pull request #30276 from nextcloud/feature/add_oauth2_migration
Add oauth2_clients migration for Owncloud
Diffstat (limited to 'apps')
-rw-r--r--apps/oauth2/lib/Migration/Version010402Date20190107124745.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/oauth2/lib/Migration/Version010402Date20190107124745.php b/apps/oauth2/lib/Migration/Version010402Date20190107124745.php
index ff9a628712a..b80e3a9575f 100644
--- a/apps/oauth2/lib/Migration/Version010402Date20190107124745.php
+++ b/apps/oauth2/lib/Migration/Version010402Date20190107124745.php
@@ -42,9 +42,12 @@ class Version010402Date20190107124745 extends SimpleMigrationStep {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
- $table = $schema->getTable('oauth2_clients');
- $table->dropIndex('oauth2_client_id_idx');
- $table->addUniqueIndex(['client_identifier'], 'oauth2_client_id_idx');
- return $schema;
+ // During an ownCloud migration, the client_identifier column identifier might not exist yet.
+ if ($schema->getTable('oauth2_clients')->hasColumn('client_identifier')) {
+ $table = $schema->getTable('oauth2_clients');
+ $table->dropIndex('oauth2_client_id_idx');
+ $table->addUniqueIndex(['client_identifier'], 'oauth2_client_id_idx');
+ return $schema;
+ }
}
}