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