summaryrefslogtreecommitdiffstats
path: root/apps/workflowengine/lib/Migration
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2019-08-27 17:51:10 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2019-09-09 22:56:03 +0200
commit827dd896fa903bb86f3434034952bb0e435a230c (patch)
tree2f5a76d1fcf5839f17264e1e92f80fe73ff6ea6f /apps/workflowengine/lib/Migration
parentfe2a78609ab2b69e5540657ffea50d3c1f859001 (diff)
downloadnextcloud-server-827dd896fa903bb86f3434034952bb0e435a230c.tar.gz
nextcloud-server-827dd896fa903bb86f3434034952bb0e435a230c.zip
extend DB table, manager, controller with support for entity events
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/workflowengine/lib/Migration')
-rw-r--r--apps/workflowengine/lib/Migration/Version2019Date20190808074233.php14
1 files changed, 14 insertions, 0 deletions
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' => '[]',
+ ]);
+ }
}