Skip to content

Commit

Permalink
fixup! fix: make sure inbound_password uses null as default
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kesselberg <[email protected]>
  • Loading branch information
kesselb committed Jul 1, 2024
1 parent 4ee7334 commit 368334c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/Migration/Version3800Date20240628163133.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@

use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

class Version3800Date20240628163133 extends SimpleMigrationStep {

public function __construct(
private IDBConnection $connection
) {
}

public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
Expand All @@ -39,4 +45,11 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
return null;
}

public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
$qb = $this->connection->getQueryBuilder();
$qb->update('mail_accounts')
->set('inbound_password', $qb->createNamedParameter(null, IQueryBuilder::PARAM_NULL))
->where($qb->expr()->emptyString('inbound_password'));
$qb->executeStatement();
}
}

0 comments on commit 368334c

Please sign in to comment.