hasTable('wfda_workflows')) { return null; } $table = $schema->getTable('wfda_workflows'); if ($table->hasColumn('notify_mode')) { return null; } $table->addColumn('notify_mode', Types::STRING, [ 'notnull' => true, 'length' => 16, 'default' => 'off', ]); return $schema; } public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void { /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); if (!$schema->hasTable('wfda_workflows') || !$schema->getTable('wfda_workflows')->hasColumn('notify_email')) { return; } $qb = $this->db->getQueryBuilder(); $qb->update('wfda_workflows') ->set('notify_mode', $qb->createNamedParameter('owner')) ->where($qb->expr()->eq('notify_email', $qb->createNamedParameter(true, IQueryBuilder::PARAM_BOOL))); $qb->executeStatement(); } }