| 110 |
return "\nImproper database connection settings.\n\n"; |
return "\nImproper database connection settings.\n\n"; |
| 111 |
} |
} |
| 112 |
|
|
| 113 |
|
// Define paths |
| 114 |
$dump_location = "$dump_path/$branch"; |
$dump_location = "$dump_path/$branch"; |
| 115 |
$lastmerge_location = "$dump_path/$lastmerge_branch"; |
$lastmerge_location = "$dump_path/$lastmerge_branch"; |
| 116 |
$temp_branch = "tmp"; |
$temp_branch = "tmp"; |
| 355 |
exec("echo \"$line\" >> $rewritten_version"); |
exec("echo \"$line\" >> $rewritten_version"); |
| 356 |
} |
} |
| 357 |
|
|
| 358 |
// Convert the file to SQL |
// Convert the file back to SQL |
| 359 |
|
|
| 360 |
|
// Get an array of the last-merge sql file |
| 361 |
$sql = file("$lastmerge_version", FILE_IGNORE_NEW_LINES); |
$sql = file("$lastmerge_version", FILE_IGNORE_NEW_LINES); |
| 362 |
|
|
| 363 |
// Get the top sql comments |
// Get the top sql comments |
| 1413 |
|
|
| 1414 |
|
|
| 1415 |
/** |
/** |
| 1416 |
* Raise the increments of the given table within the given branch |
* Raise the increments, and its foreign keys, of the given table within the |
| 1417 |
|
* given branch |
| 1418 |
* |
* |
| 1419 |
* @param $table |
* @param $table |
| 1420 |
* Table to raise the increments of |
* Table to raise the increments of |
| 1603 |
exec("sed 's/ AUTO_INCREMENT={$current_inc['num']} / AUTO_INCREMENT={$increment_change} /g' $branch_location/tables/$table.sql > $temp_location/$table.sql"); |
exec("sed 's/ AUTO_INCREMENT={$current_inc['num']} / AUTO_INCREMENT={$increment_change} /g' $branch_location/tables/$table.sql > $temp_location/$table.sql"); |
| 1604 |
exec("mv $temp_location/$table.sql $branch_location/tables/$table.sql"); |
exec("mv $temp_location/$table.sql $branch_location/tables/$table.sql"); |
| 1605 |
|
|
| 1606 |
// For all references, raise the increment |
// Raise the increment for all foreign keys of the given table |
| 1607 |
foreach ($table_references['references'] as $table_to_modify => $columns_referenced) { |
foreach ($table_references['references'] as $table_to_modify => $columns_referenced) { |
| 1608 |
|
|
| 1609 |
// Check if this table exists and has any data stored |
// Check if this table exists and has any data stored |