diff --git a/Migrations/Migrator.php b/Migrations/Migrator.php
index <HASH>..<HASH> 100755
--- a/Migrations/Migrator.php
+++ b/Migrations/Migrator.php
@@ -470,7 +470,7 @@ class Migrator
     {
         $class = $this->getMigrationClass($this->getMigrationName($path));
 
-        if (class_exists($class)) {
+        if (class_exists($class) && realpath($path) == (new ReflectionClass($class))->getFileName()) {
             return new $class;
         }
[8.x] Allow anonymous and class based migration coexisting (#<I>)

* Update test to fail



* Validate file path