Skip to content

Commit 48608db

Browse files
committed
avoid empty null default with value that will be inserted anyways
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
1 parent adcb73d commit 48608db

2 files changed

Lines changed: 2 additions & 13 deletions

File tree

apps/workflowengine/lib/Migration/PopulateNewlyIntroducedDatabaseFields.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
namespace OCA\WorkflowEngine\Migration;
2626

2727
use Doctrine\DBAL\Driver\Statement;
28-
use OCA\WorkflowEngine\Entity\File;
2928
use OCP\IDBConnection;
3029
use OCP\Migration\IOutput;
3130
use OCP\Migration\IRepairStep;
@@ -51,17 +50,6 @@ public function run(IOutput $output) {
5150

5251
$result->closeCursor();
5352

54-
$this->populateEntityCol();
55-
}
56-
57-
protected function populateEntityCol() {
58-
$qb = $this->dbc->getQueryBuilder();
59-
60-
$qb->update('flow_operations')
61-
->set('entity', $qb->createNamedParameter(File::class))
62-
->where($qb->expr()->emptyString('entity'))
63-
->execute();
64-
6553
}
6654

6755
protected function populateScopeTable(Statement $ids): void {

apps/workflowengine/lib/Migration/Version2000Date20190808074233.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Closure;
88
use Doctrine\DBAL\Schema\Table;
99
use Doctrine\DBAL\Types\Type;
10+
use OCA\WorkflowEngine\Entity\File;
1011
use OCP\DB\ISchemaWrapper;
1112
use OCP\Migration\IOutput;
1213
use OCP\Migration\SimpleMigrationStep;
@@ -116,7 +117,7 @@ protected function ensureEntityColumns(Table $table) {
116117
$table->addColumn('entity', Type::STRING, [
117118
'notnull' => true,
118119
'length' => 256,
119-
'default' => '',
120+
'default' => File::class,
120121
]);
121122
}
122123
if(!$table->hasColumn('events')) {

0 commit comments

Comments
 (0)