diff --git a/classes/OpenXdmod/Migration/Version900To950/DatabaseMigration.php b/classes/OpenXdmod/Migration/Version900To950/DatabaseMigration.php index aaf32a6210..13704e4dc0 100644 --- a/classes/OpenXdmod/Migration/Version900To950/DatabaseMigration.php +++ b/classes/OpenXdmod/Migration/Version900To950/DatabaseMigration.php @@ -22,6 +22,18 @@ public function execute() $dbh = DB::factory('datawarehouse'); $mysql_helper = \CCR\DB\MySQLHelper::factory($dbh); + + if ($mysql_helper->tableExists('modw_cloud.event')) { + + Utilities::runEtlPipeline( + ['cloud-migration-9_0_0-9_5_0'], + $this->logger, + [ + 'last-modified-start-date' => '2017-01-01 00:00:00' + ] + ); + } + if ($mysql_helper->tableExists('modw_cloud.cloud_resource_specs')) { $staging_resource_sql = "SELECT @@ -47,7 +59,7 @@ public function execute() } Utilities::runEtlPipeline( - ['cloud-migration-9_0_0-9_5_0'], + ['cloud-resource-specs-migration-9_0_0-9_5_0'], $this->logger, [ 'last-modified-start-date' => '2017-01-01 00:00:00' diff --git a/configuration/etl/etl.d/xdmod-migration-9_0_0-9_5_0.json b/configuration/etl/etl.d/xdmod-migration-9_0_0-9_5_0.json index 49d8d3834d..fd9eea19a1 100644 --- a/configuration/etl/etl.d/xdmod-migration-9_0_0-9_5_0.json +++ b/configuration/etl/etl.d/xdmod-migration-9_0_0-9_5_0.json @@ -23,7 +23,26 @@ "schema": "modw_cloud" } } - } + }, + "cloud-resource-specs-migration-9_0_0-9_5_0": { + "namespace": "ETL\\Ingestor", + "options_class": "IngestorOptions", + "endpoints": { + "source": { + "type": "mysql", + "name": "Cloud DB", + "config": "datawarehouse", + "schema": "modw_cloud" + }, + "destination": { + "type": "mysql", + "name": "Cloud DB", + "config": "datawarehouse", + "schema": "modw_cloud", + "truncate_destination": true + } + } + } }, "migration-9_0_0-9_5_0": [ { @@ -165,21 +184,14 @@ "explode_column": { "session_id_list": "session_id" } - }, + } + ], + "cloud-resource-specs-migration-9_0_0-9_5_0": [ { "name": "CloudResourceSpecsReconstructor", "class": "CloudResourceSpecsStateTransformIngestor", "definition_file": "cloud_common/resource_specifications_transformer.json", - "description": "Sets a start and end time for memory and vcpu paring for a compute node on a cloud resource", - "endpoints": { - "destination": { - "type": "mysql", - "name": "Cloud DB", - "config": "datawarehouse", - "schema": "modw_cloud", - "truncate_destination": true - } - } + "description": "Sets a start and end time for memory and vcpu paring for a compute node on a cloud resource" }, { "#": "Asset data must be aggregated post ingestion", @@ -194,14 +206,14 @@ "day", "month", "quarter", "year" ], "endpoints": { - "destination": { - "type": "mysql", - "name": "Aggregate DB", - "config": "datawarehouse", - "schema": "modw_aggregates", - "create_schema_if_not_exists": true, - "truncate_destination": true - } + "destination": { + "type": "mysql", + "name": "Aggregate DB", + "config": "datawarehouse", + "schema": "modw_aggregates", + "create_schema_if_not_exists": true, + "truncate_destination": true + } } } ]