Skip to content

Commit 7e651fe

Browse files
committed
✨ add executedMigration() method to check a file executed
Signed-off-by: otengkwame <[email protected]>
1 parent ccf543d commit 7e651fe

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Core/controllers/commands/Migration.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,22 @@ private function migrationRequirements()
170170
}
171171
}
172172

173+
/**
174+
* Check Executed Migration
175+
*
176+
* This checks if a single migration file has
177+
* been run earlier
178+
*
179+
* @param string $file
180+
* @return mixed
181+
*/
182+
private function executedMigration($file)
183+
{
184+
return $this->db
185+
->where('migration', $file)
186+
->get(self::TABLE)->first_row();
187+
}
188+
173189
/**
174190
* Executed Migrations
175191
*

0 commit comments

Comments
 (0)