moving the right outer join condition inside the where clause where the databases are selected from the migration_log table.