diff --git a/src/migrator/full_migration.py b/src/migrator/full_migration.py index f59d175..be9d731 100644 --- a/src/migrator/full_migration.py +++ b/src/migrator/full_migration.py @@ -161,6 +161,7 @@ class FullMigrator: # Get final actual count from PostgreSQL final_count = pg_conn.get_row_count(pg_table) + logger.info(f"Final count from PostgreSQL: {final_count}") # Update migration state with final count and mark as completed # Get the actual last ID from the table @@ -171,12 +172,16 @@ class FullMigrator: ) result = cursor.fetchone() final_last_id = result[0] if result and result[0] else None - except Exception: + logger.info(f"Final last ID from table: {final_last_id}") + except Exception as e: + logger.warning(f"Failed to get final last ID: {e}") final_last_id = None + logger.info(f"About to update migration_state with count={final_count}, last_id={final_last_id}") self._update_migration_state( pg_conn, final_count, final_last_id, migration_start_time ) + logger.info(f"Migration state update complete") logger.info( f"✓ Migration complete: {final_count} total rows in {pg_table}"