Merge pull request #24315 from nextcloud/fix/23174/flow-ops-fix-default-value
avoid empty null default with value that will be inserted anyways
This commit is contained in:
commit
6d3d6fb81a
|
@ -26,7 +26,6 @@ declare(strict_types=1);
|
||||||
namespace OCA\WorkflowEngine\Migration;
|
namespace OCA\WorkflowEngine\Migration;
|
||||||
|
|
||||||
use Doctrine\DBAL\Driver\Statement;
|
use Doctrine\DBAL\Driver\Statement;
|
||||||
use OCA\WorkflowEngine\Entity\File;
|
|
||||||
use OCP\IDBConnection;
|
use OCP\IDBConnection;
|
||||||
use OCP\Migration\IOutput;
|
use OCP\Migration\IOutput;
|
||||||
use OCP\Migration\IRepairStep;
|
use OCP\Migration\IRepairStep;
|
||||||
|
@ -51,17 +50,6 @@ class PopulateNewlyIntroducedDatabaseFields implements IRepairStep {
|
||||||
$this->populateScopeTable($result);
|
$this->populateScopeTable($result);
|
||||||
|
|
||||||
$result->closeCursor();
|
$result->closeCursor();
|
||||||
|
|
||||||
$this->populateEntityCol();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function populateEntityCol() {
|
|
||||||
$qb = $this->dbc->getQueryBuilder();
|
|
||||||
|
|
||||||
$qb->update('flow_operations')
|
|
||||||
->set('entity', $qb->createNamedParameter(File::class))
|
|
||||||
->where($qb->expr()->emptyString('entity'))
|
|
||||||
->execute();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function populateScopeTable(Statement $ids): void {
|
protected function populateScopeTable(Statement $ids): void {
|
||||||
|
|
|
@ -7,6 +7,7 @@ namespace OCA\WorkflowEngine\Migration;
|
||||||
use Closure;
|
use Closure;
|
||||||
use Doctrine\DBAL\Schema\Table;
|
use Doctrine\DBAL\Schema\Table;
|
||||||
use Doctrine\DBAL\Types\Types;
|
use Doctrine\DBAL\Types\Types;
|
||||||
|
use OCA\WorkflowEngine\Entity\File;
|
||||||
use OCP\DB\ISchemaWrapper;
|
use OCP\DB\ISchemaWrapper;
|
||||||
use OCP\Migration\IOutput;
|
use OCP\Migration\IOutput;
|
||||||
use OCP\Migration\SimpleMigrationStep;
|
use OCP\Migration\SimpleMigrationStep;
|
||||||
|
@ -116,7 +117,7 @@ class Version2000Date20190808074233 extends SimpleMigrationStep {
|
||||||
$table->addColumn('entity', Types::STRING, [
|
$table->addColumn('entity', Types::STRING, [
|
||||||
'notnull' => true,
|
'notnull' => true,
|
||||||
'length' => 256,
|
'length' => 256,
|
||||||
'default' => '',
|
'default' => File::class,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
if (!$table->hasColumn('events')) {
|
if (!$table->hasColumn('events')) {
|
||||||
|
|
Loading…
Reference in New Issue