Ordenamiento de tables BPMN en backup

This commit is contained in:
Brayan Osmar Pereyra Suxo
2014-09-16 15:18:11 -04:00
parent d38808c062
commit 2f6575f369

View File

@@ -489,6 +489,12 @@ class DataBaseMaintenance
*/
function backupDataBase ($outfile)
{
$tablesBpmn = array(
'BPMN_PROJECT','BPMN_DIAGRAM','BPMN_DOCUMENTATION','BPMN_EXTENSION','BPMN_PARTICIPANT',
'BPMN_PROCESS','BPMN_ACTIVITY','BPMN_ARTIFACT','BPMN_DATA','BPMN_EVENT','BPMN_GATEWAY',
'BPMN_LANESET','BPMN_BOUND','BPMN_FLOW','BPMN_LANE'
);
$sqlTablesBpmn = array();
$aTables = $this->getTablesList();
$ws = explode( '_', $this->dbName );
$ws = isset( $ws[1] ) ? $ws[1] : $this->dbName;
@@ -510,9 +516,17 @@ class DataBaseMaintenance
$tableSchema = "\nDROP TABLE IF EXISTS `$table`;\n\n";
$tableSchema .= $this->getSchemaFromTable( $table );
$data = $this->dumpSqlInserts( $table );
if (in_array($table, $tablesBpmn)) {
$sqlTablesBpmn[$table] = $tableSchema . $data;
} else {
fwrite( $file, $tableSchema );
fwrite( $file, $data );
}
}
foreach ($tablesBpmn as $table) {
fwrite( $file, $sqlTablesBpmn[$table] );
}
fclose( $file );
}