-
Notifications
You must be signed in to change notification settings - Fork 1
/
migrate.php
33 lines (28 loc) · 815 Bytes
/
migrate.php
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
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
ini_set("memory_limit", "-1");
require_once 'Init.php';
require_once 'Common.php';
require_once 'KeyGenerator.php';
$options = getopt('o:');
$tableList = Init::getTableList();
$i = 0;
try {
foreach ($tableList as $table) {
require_once getcwd() . '/tables/' . $table . '.php';
$c = new $table();
echo "\n$table Migration Started...." . PHP_EOL;
try{
$c->run($options);
$i++;
echo "$table migration Complete...." . PHP_EOL;
} catch (\Exception $e){
echo $table. ' Migration Failed. Reason : '. $e->getMessage();
}
}
echo "\n\n $i Tables migrated Successfully" . PHP_EOL;
} catch (Exception $e) {
echo $e->getMessage();
}
?>