diff --git a/apps/workflowengine/appinfo/database.xml b/apps/workflowengine/appinfo/database.xml deleted file mode 100644 index b67a41faed..0000000000 --- a/apps/workflowengine/appinfo/database.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - *dbname* - true - false - utf8 - - - *dbprefix*flow_checks - - - id - integer - 0 - true - 1 - 4 - - - - class - text - true - 256 - - - operator - text - true - 16 - - - value - clob - false - - - hash - text - true - 32 - - - - flow_unique_hash - true - - hash - - - -
- - - *dbprefix*flow_operations - - - id - integer - 0 - true - 1 - 4 - - - - class - text - true - 256 - - - name - text - true - 256 - - - checks - clob - false - - - operation - clob - false - - -
-
diff --git a/apps/workflowengine/composer/composer/autoload_classmap.php b/apps/workflowengine/composer/composer/autoload_classmap.php index 7d73b3a624..14fca1fce4 100644 --- a/apps/workflowengine/composer/composer/autoload_classmap.php +++ b/apps/workflowengine/composer/composer/autoload_classmap.php @@ -21,5 +21,6 @@ return array( 'OCA\\WorkflowEngine\\Controller\\GlobalWorkflowsController' => $baseDir . '/../lib/Controller/GlobalWorkflowsController.php', 'OCA\\WorkflowEngine\\Controller\\RequestTime' => $baseDir . '/../lib/Controller/RequestTime.php', 'OCA\\WorkflowEngine\\Manager' => $baseDir . '/../lib/Manager.php', + 'OCA\\WorkflowEngine\\Migration\\Version2019Date20190808074233' => $baseDir . '/../lib/Migration/Version2019Date20190808074233.php', 'OCA\\WorkflowEngine\\Settings\\Section' => $baseDir . '/../lib/Settings/Section.php', ); diff --git a/apps/workflowengine/composer/composer/autoload_static.php b/apps/workflowengine/composer/composer/autoload_static.php index 8d54000260..7af16f5370 100644 --- a/apps/workflowengine/composer/composer/autoload_static.php +++ b/apps/workflowengine/composer/composer/autoload_static.php @@ -36,6 +36,7 @@ class ComposerStaticInitWorkflowEngine 'OCA\\WorkflowEngine\\Controller\\GlobalWorkflowsController' => __DIR__ . '/..' . '/../lib/Controller/GlobalWorkflowsController.php', 'OCA\\WorkflowEngine\\Controller\\RequestTime' => __DIR__ . '/..' . '/../lib/Controller/RequestTime.php', 'OCA\\WorkflowEngine\\Manager' => __DIR__ . '/..' . '/../lib/Manager.php', + 'OCA\\WorkflowEngine\\Migration\\Version2019Date20190808074233' => __DIR__ . '/..' . '/../lib/Migration/Version2019Date20190808074233.php', 'OCA\\WorkflowEngine\\Settings\\Section' => __DIR__ . '/..' . '/../lib/Settings/Section.php', ); diff --git a/apps/workflowengine/lib/Migration/Version2019Date20190808074233.php b/apps/workflowengine/lib/Migration/Version2019Date20190808074233.php new file mode 100644 index 0000000000..cedee43a9e --- /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; + } +}