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

Refs #14300.

Thanks Markus Holtermann for the report and the original attempt.