Fixed #21115 -- Fixes NameError in migrate --list command