Mark fixtures as created if they exist.

Fixes #2905
This commit is contained in:
mark_story 2012-06-24 12:57:54 -04:00
parent b913fe5303
commit 503bc06c70

View file

@ -169,12 +169,15 @@ class CakeFixtureManager {
$sources = $db->listSources();
$table = $db->config['prefix'] . $fixture->table;
$exists = in_array($table, $sources);
if ($drop && in_array($table, $sources)) {
if ($drop && $exists) {
$fixture->drop($db);
$fixture->create($db);
} elseif (!in_array($table, $sources)) {
} elseif (!$exists) {
$fixture->create($db);
} else {
$fixture->created[] = $db->configKeyName;
}
}