Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
avoid empty null default with value that will be inserted anyways
Signed-off-by: Arthur Schiwon <[email protected]>
  • Loading branch information
blizzz committed Nov 24, 2020
commit 48608db9be01cce1262a112f9c9cf34b13ff7da1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,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) {

$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\Type;
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', Type::STRING, [
'notnull' => true,
'length' => 256,
'default' => '',
'default' => File::class,
]);
}
if(!$table->hasColumn('events')) {
Expand Down