mirror of
https://github.com/Oreolek/kohana-migrations.git
synced 2024-06-30 21:55:05 +03:00
Fixing a bug where the migration model gets mixed up if you pass in a numerically
indexed array of locations as opposed to an associative one
This commit is contained in:
parent
3021f5727b
commit
8406255305
|
@ -184,6 +184,20 @@ class Model_Minion_Migration extends Model
|
||||||
$locations = $this->fetch_all('location', 'location');
|
$locations = $this->fetch_all('location', 'location');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// If the calling script has been lazy and given us a numerically
|
||||||
|
// indexed array of locations then we need to convert it to a mirrored
|
||||||
|
// array
|
||||||
|
//
|
||||||
|
// We will decide the target version for these within the loop below
|
||||||
|
elseif( ! Arr::is_assoc($locations))
|
||||||
|
{
|
||||||
|
foreach($locations as $_pos => $location)
|
||||||
|
{
|
||||||
|
unset($locations[$_pos]);
|
||||||
|
|
||||||
|
$locations[$location] = $location;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Merge locations with specified target versions
|
// Merge locations with specified target versions
|
||||||
if( ! empty($target_version) AND is_array($target_version))
|
if( ! empty($target_version) AND is_array($target_version))
|
||||||
|
|
Loading…
Reference in a new issue