check if a package or module exists before running a migration