db = $db; } /** * @param IOutput $output * @param Closure $schemaClosure * @param array $options * @return null|ISchemaWrapper */ #[\Override] public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); $table = $schema->getTable('mail_mailboxes'); if (!$table->hasColumn('my_acls')) { $table->addColumn('my_acls', Types::STRING, [ 'length' => 32, 'notnull' => false, ]); } return $schema; } /** * @param IOutput $output * @param Closure $schemaClosure * @param array $options */ #[\Override] public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void { $qb = $this->db->getQueryBuilder(); $qb->update('mail_accounts') ->set('last_mailbox_sync', $qb->createNamedParameter(0, IQueryBuilder::PARAM_INT)); $qb->executeStatement(); } }