From 827dd896fa903bb86f3434034952bb0e435a230c Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Tue, 27 Aug 2019 17:51:10 +0200 Subject: extend DB table, manager, controller with support for entity events Signed-off-by: Arthur Schiwon --- .../lib/Migration/Version2019Date20190808074233.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'apps/workflowengine/lib/Migration') diff --git a/apps/workflowengine/lib/Migration/Version2019Date20190808074233.php b/apps/workflowengine/lib/Migration/Version2019Date20190808074233.php index cedee43a9eb..2b9a8aa17cd 100644 --- a/apps/workflowengine/lib/Migration/Version2019Date20190808074233.php +++ b/apps/workflowengine/lib/Migration/Version2019Date20190808074233.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace OCA\WorkflowEngine\Migration; use Closure; +use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Types\Type; use OCP\DB\ISchemaWrapper; use OCP\Migration\SimpleMigrationStep; @@ -69,7 +70,13 @@ class Version2019Date20190808074233 extends SimpleMigrationStep { $table->addColumn('operation', Type::TEXT, [ 'notnull' => false, ]); + $this->addEventsColumn($table); $table->setPrimaryKey(['id']); + } else { + $table = $schema->getTable('flow_operations'); + if(!$table->hasColumn('events')) { + $this->addEventsColumn($table); + } } if (!$schema->hasTable('flow_operations_scope')) { @@ -97,4 +104,11 @@ class Version2019Date20190808074233 extends SimpleMigrationStep { return $schema; } + + protected function addEventsColumn(Table $table) { + $table->addColumn('events', Type::TEXT, [ + 'notnull' => true, + 'default' => '[]', + ]); + } } -- cgit v1.2.3