Fixed #23618 -- Allowed apps with no models to still have migrations

Basically a4737bf6ae reapplied.
Updated gis_migrations tests