diff options
author | Louis Chemineau <louis@chmn.me> | 2021-12-16 16:46:03 +0100 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2022-03-24 18:08:43 +0100 |
commit | c5722869be32ced505d71b11f5e1ea8e169aae57 (patch) | |
tree | ce72d16100e8e0263529c6a8a2bdf8b6014ff7fa /apps/oauth2 | |
parent | c9ea2363b1e50748b7c85f1e14b036c3d92cc31a (diff) | |
download | nextcloud-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.php | 11 |
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; + } } } |