Merge pull request #24072 from nextcloud/fix-storage-credential-migration
fix migration of oc_credentials table
This commit is contained in:
commit
29b97468f8
|
@ -52,6 +52,7 @@ class Version20000Date20201109081918 extends SimpleMigrationStep {
|
|||
/** @var ISchemaWrapper $schema */
|
||||
$schema = $schemaClosure();
|
||||
|
||||
if (!$schema->hasTable('storages_credentials')) {
|
||||
$table = $schema->createTable('storages_credentials');
|
||||
$table->addColumn('id', Type::BIGINT, [
|
||||
'autoincrement' => true,
|
||||
|
@ -72,6 +73,7 @@ class Version20000Date20201109081918 extends SimpleMigrationStep {
|
|||
$table->setPrimaryKey(['id']);
|
||||
$table->addUniqueIndex(['user', 'identifier'], 'stocred_ui');
|
||||
$table->addIndex(['user'], 'stocred_user');
|
||||
}
|
||||
|
||||
return $schema;
|
||||
}
|
||||
|
@ -92,9 +94,9 @@ class Version20000Date20201109081918 extends SimpleMigrationStep {
|
|||
|
||||
$insert = $this->connection->getQueryBuilder();
|
||||
$insert->insert('storages_credentials')
|
||||
->setValue('user', $insert->createNamedParameter('user'))
|
||||
->setValue('identifier', $insert->createNamedParameter('identifier'))
|
||||
->setValue('credentials', $insert->createNamedParameter('credentials'));
|
||||
->setValue('user', $insert->createParameter('user'))
|
||||
->setValue('identifier', $insert->createParameter('identifier'))
|
||||
->setValue('credentials', $insert->createParameter('credentials'));
|
||||
|
||||
$result = $query->execute();
|
||||
while ($row = $result->fetch()) {
|
||||
|
|
Loading…
Reference in New Issue