We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ef1d637 commit cd1d6daCopy full SHA for cd1d6da
src/AntiMattr/MongoDB/Migrations/Version.php
@@ -298,7 +298,10 @@ public function markMigrated($replay = false)
298
299
if ($replay) {
300
$query = array('v' => $this->version);
301
- $collection->update($query, $document);
+ // If the user asked for a 'replay' of a migration that
302
+ // has not been run, it will be inserted anew
303
+ $options = array('upsert' => true);
304
+ $collection->update($query, $document, $options);
305
} else {
306
$collection->insert($document);
307
}
0 commit comments