forked from ubccr/xdmod
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatabasesMigration.php
More file actions
54 lines (46 loc) · 1.76 KB
/
Copy pathDatabasesMigration.php
File metadata and controls
54 lines (46 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* Update database from version 11.0.3 to 11.5.0
*/
namespace OpenXdmod\Migration\Version1103To1150;
use OpenXdmod\Migration\DatabasesMigration as AbstractDatabasesMigration;
use OpenXdmod\Shared\DatabaseHelper;
use ETL\Utilities;
use CCR\DB;
use CCR\DB\MySQLHelper;
class DatabasesMigration extends AbstractDatabasesMigration
{
public function execute()
{
$dataWarehouseAdminCredentials = $this->requestMysqlAdminCredentials();
// Create the modw_etl schema.
DatabaseHelper::createDatabases(
$dataWarehouseAdminCredentials['user'],
$dataWarehouseAdminCredentials['pass'],
array(
'db_host' => \xd_utilities\getConfiguration('datawarehouse', 'host'),
'db_port' => \xd_utilities\getConfiguration('datawarehouse', 'port'),
'db_user' => \xd_utilities\getConfiguration('datawarehouse', 'user'),
'db_pass' => \xd_utilities\getConfiguration('datawarehouse', 'pass'),
),
array('modw_etl')
);
parent::execute();
$dbh = DB::factory('datawarehouse');
$mysql_helper = MySQLHelper::factory($dbh);
if ($mysql_helper->tableExists('modw.storagefact')) {
Utilities::runEtlPipeline(
['storage-migration-11_0_3-11_5_0', 'xdw-aggregate-storage'],
$this->logger,
['last-modified-start-date' => '2017-01-01 00:00:00']
);
}
if ($mysql_helper->tableExists('modw_cloud.event')) {
Utilities::runEtlPipeline(
['cloud-migration_11-0-3_11-5-0', 'cloud-state-pipeline'],
$this->logger,
['last-modified-start-date' => '2017-01-01 00:00:00']
);
}
}
}