summaryrefslogtreecommitdiffstats
path: root/apps/oauth2
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2021-12-16 16:46:03 +0100
committerLouis Chemineau <louis@chmn.me>2022-03-24 18:08:43 +0100
commitc5722869be32ced505d71b11f5e1ea8e169aae57 (patch)
treece72d16100e8e0263529c6a8a2bdf8b6014ff7fa /apps/oauth2
parentc9ea2363b1e50748b7c85f1e14b036c3d92cc31a (diff)
downloadnextcloud-server-c5722869be32ced505d71b11f5e1ea8e169aae57.tar.gz
nextcloud-server-c5722869be32ced505d71b11f5e1ea8e169aae57.zip
Add oauth2_clients migration for Owncloud
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'apps/oauth2')
-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;
+ }
}
}