Fixed #21283 -- Added support for migrations if models is a package.

Refs #14300.