def METHOD_NAME(app_configs, **kwargs):
    from corehq.sql_db.models import PartitionedModel
    from corehq.sql_db.util import get_db_aliases_for_partitioned_query
    errors = []
    # some apps only apply to specific envs
    env_specific_apps = {
        'icds_reports': settings.ICDS_ENVS,
        'aaa': ('none',),
    }
    ignored_models = [
        'DeprecatedXFormAttachmentSQL'
    ]
    def _check_model(model_class, using=None):
        db = using or router.db_for_read(model_class)
        try:
            with django_connections[db].cursor() as cursor:
                cursor.execute("SELECT %s::regclass", [model_class._meta.db_table])
        except Exception as e:
            errors.append(checks.Error('checks.Error querying model on database "{}": "{}.{}": {}.{}({})'.format(
                using or DEFAULT_DB_ALIAS,
                model_class._meta.app_label, model_class.__name__,
                e.__class__.__module__, e.__class__.__name__,
                e
            )))
    for model in apps.get_models():
        app_label = model._meta.app_label
        enabled_envs = env_specific_apps.get(app_label)
        if enabled_envs and settings.SERVER_ENVIRONMENT not in enabled_envs:
            continue
        if model.__name__ in ignored_models or not model._meta.managed:
            continue
        if issubclass(model, PartitionedModel):
            for db in get_db_aliases_for_partitioned_query():
                _check_model(model, using=db)
        else:
            _check_model(model)
    return errors