From 9a6f7cc8cb5aef8d0c9dfb29fbed4a02e331e647 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Thu, 8 Aug 2019 10:29:17 +0200 Subject: add scope table for workflows and switch to migrations Signed-off-by: Arthur Schiwon --- .../Migration/Version2019Date20190808074233.php | 100 +++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 apps/workflowengine/lib/Migration/Version2019Date20190808074233.php (limited to 'apps/workflowengine/lib') diff --git a/apps/workflowengine/lib/Migration/Version2019Date20190808074233.php b/apps/workflowengine/lib/Migration/Version2019Date20190808074233.php new file mode 100644 index 00000000000..cedee43a9eb --- /dev/null +++ b/apps/workflowengine/lib/Migration/Version2019Date20190808074233.php @@ -0,0 +1,100 @@ +hasTable('flow_checks')) { + $table = $schema->createTable('flow_checks'); + $table->addColumn('id', Type::INTEGER, [ + 'autoincrement' => true, + 'notnull' => true, + 'length' => 4, + ]); + $table->addColumn('class', Type::STRING, [ + 'notnull' => true, + 'length' => 256, + ]); + $table->addColumn('operator', Type::STRING, [ + 'notnull' => true, + 'length' => 16, + ]); + $table->addColumn('value', Type::TEXT, [ + 'notnull' => false, + ]); + $table->addColumn('hash', Type::STRING, [ + 'notnull' => true, + 'length' => 32, + ]); + $table->setPrimaryKey(['id']); + $table->addUniqueIndex(['hash'], 'flow_unique_hash'); + } + + if (!$schema->hasTable('flow_operations')) { + $table = $schema->createTable('flow_operations'); + $table->addColumn('id', Type::INTEGER, [ + 'autoincrement' => true, + 'notnull' => true, + 'length' => 4, + ]); + $table->addColumn('class', Type::STRING, [ + 'notnull' => true, + 'length' => 256, + ]); + $table->addColumn('name', Type::STRING, [ + 'notnull' => true, + 'length' => 256, + ]); + $table->addColumn('checks', Type::TEXT, [ + 'notnull' => false, + ]); + $table->addColumn('operation', Type::TEXT, [ + 'notnull' => false, + ]); + $table->setPrimaryKey(['id']); + } + + if (!$schema->hasTable('flow_operations_scope')) { + $table = $schema->createTable('flow_operations_scope'); + $table->addColumn('id', Type::BIGINT, [ + 'autoincrement' => true, + 'notnull' => true, + 'length' => 4, + ]); + $table->addColumn('operation_id', Type::INTEGER, [ + 'notnull' => true, + 'length' => 4, + ]); + $table->addColumn('type', Type::INTEGER, [ + 'notnull' => true, + 'length' => 4, + ]); + $table->addColumn('value', Type::STRING, [ + 'notnull' => false, + 'length' => 64, + ]); + $table->setPrimaryKey(['id']); + $table->addUniqueIndex(['operation_id', 'type', 'value'], 'flow_unique_scope'); + } + + return $schema; + } +} -- cgit v1.2.3