def migrate_tenant_apps(self, schema_name=None):
        self._save_south_settings()

        apps = self.tenant_apps or self.installed_apps
        self._set_managed_apps(included_apps=apps, excluded_apps=self.shared_apps)

        if schema_name:
            self._notice("=== Running migrate for schema: %s" % schema_name)
            connection.set_schema_to_public()
            tenant = get_tenant_model().objects.get(schema_name=schema_name)
            self._migrate_schema(tenant)
        else:
            all_tenants = get_tenant_model().objects.exclude(schema_name=get_public_schema_name())
            if not all_tenants:
                self._notice("No tenants found")

            for tenant in all_tenants:
                Migrations._dependencies_done = False  # very important, the dependencies need to be purged from cache
                self._notice(tenant.schema_name % "=== Running migrate for schema %s")
                self._migrate_schema(tenant)

        self._restore_south_settings()
dataset/ETHPy150Open bernardopires/django-tenant-schemas/tenant_schemas/management/commands/legacy/migrate_schemas.py/Command.migrate_tenant_apps/swapped operands of `%`