diff --git a/PyFunceble/engine/database/migrations/old2new.py b/PyFunceble/engine/database/migrations/old2new.py
index <HASH>..<HASH> 100644
--- a/PyFunceble/engine/database/migrations/old2new.py
+++ b/PyFunceble/engine/database/migrations/old2new.py
@@ -253,7 +253,7 @@ class CleanupOldTables:
             statement = "DELETE FROM pyfunceble_tested WHERE id = :status_id"
 
             # pylint: disable=no-member
-            db_session.execute(statement, {"status_id": status.id})
+            db_session.execute(statement, {"status_id": data["id"]})
 
         if self.autosave.authorized or PyFunceble.CONFIGURATION.print_dots:
             PyFunceble.LOGGER.info(f'Switched {data["tested"]} to SQLAlchemy.')
Fix issue with the deletion of old entries.

This patch fix <URL>