diff options
Diffstat (limited to 'apps/oauth2/lib/Migration/Version010402Date20190107124745.php')
-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; + } } } |