Skip to content

Commit

Permalink
Merge pull request #24333 from nextcloud/backport/24315/stable20
Browse files Browse the repository at this point in the history
[stable20] avoid empty null default with value that will be inserted anyways
  • Loading branch information
nickvergessen authored Nov 26, 2020
2 parents 921f944 + 4850019 commit 61f1c12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
namespace OCA\WorkflowEngine\Migration;

use Doctrine\DBAL\Driver\Statement;
use OCA\WorkflowEngine\Entity\File;
use OCP\IDBConnection;
use OCP\Migration\IOutput;
use OCP\Migration\IRepairStep;
Expand All @@ -51,17 +50,6 @@ public function run(IOutput $output) {
$this->populateScopeTable($result);

$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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Closure;
use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Types\Types;
use OCA\WorkflowEngine\Entity\File;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
Expand Down Expand Up @@ -116,7 +117,7 @@ protected function ensureEntityColumns(Table $table) {
$table->addColumn('entity', Types::STRING, [
'notnull' => true,
'length' => 256,
'default' => '',
'default' => File::class,
]);
}
if (!$table->hasColumn('events')) {
Expand Down

0 comments on commit 61f1c12

Please sign in to comment.