avoid empty null default with value that will be inserted anyways

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2020-11-23 21:17:37 +01:00
parent e99d6b4dad
commit 52f32115e7
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
2 changed files with 2 additions and 13 deletions

View File

@ -26,7 +26,6 @@ declare(strict_types=1);
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;
@ -51,17 +50,6 @@ class PopulateNewlyIntroducedDatabaseFields implements IRepairStep {
$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 {

View File

@ -7,6 +7,7 @@ namespace OCA\WorkflowEngine\Migration;
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;
@ -116,7 +117,7 @@ class Version2000Date20190808074233 extends SimpleMigrationStep {
$table->addColumn('entity', Type::STRING, [
'notnull' => true,
'length' => 256,
'default' => '',
'default' => File::class,
]);
}
if (!$table->hasColumn('events')) {