(db, app_label, model_name=None)
Return ``True`` if a app's migrations should be applied to the specified database otherwise
    return ``False``.

    Note: returning ``None`` is tantamount to returning ``True``

    :return: Must return a boolean value, not None.
Return ``True`` if a app's migrations should be applied to the specified database otherwise
    return ``False``.
Return True if a app s migrations should be applied to the specified database otherwise return False .
def allow_migrate(db, app_label, model_name=None):
    """
    Return ``True`` if a app's migrations should be applied to the specified database otherwise
    return ``False``.

    Note: returning ``None`` is tantamount to returning ``True``

    :return: Must return a boolean value, not None.
    """
    if db and not settings.DATABASES[db].get('MIGRATE', True):
        return False

    custom_routing = settings.CUSTOM_DB_ROUTING
    if app_label in custom_routing:
        db_alias = custom_routing[app_label]
        if db_alias not in settings.DATABASES:
            db_alias = get_db_alias_or_none(db_alias)
        return bool(db_alias and db_alias == db)

    if app_label == SYNCLOGS_APP:
        return db == settings.SYNCLOGS_SQL_DB_ALIAS

    if not settings.USE_PARTITIONED_DATABASE:
        return app_label not in (PROXY_APP, PROXY_STANDBY_APP) and db in (DEFAULT_DB_ALIAS, None)

    if app_label == PROXY_APP:
        return (
            db == plproxy_config.proxy_db
            or bool(plproxy_standby_config and db == plproxy_standby_config.proxy_db)
        )
    if app_label == PROXY_STANDBY_APP:
        return bool(plproxy_standby_config and db == plproxy_standby_config.proxy_db)
    elif app_label == BLOB_DB_APP and db == DEFAULT_DB_ALIAS:
        return True
    elif app_label == BLOB_DB_APP and model_name == 'blobexpiration':
        return False
    elif app_label in (FORM_PROCESSOR_APP, SCHEDULING_PARTITIONED_APP, BLOB_DB_APP):
        return (
            db == plproxy_config.proxy_db
            or db in plproxy_config.form_processing_dbs
            or bool(plproxy_standby_config and db == plproxy_standby_config.proxy_db)
        )
    elif app_label == SQL_ACCESSORS_APP:
        return db in plproxy_config.form_processing_dbs
    else:
        return db in (DEFAULT_DB_ALIAS, None)
def allow_migrate ( db , app_label , model_name = None ) : if db and not settings . DATABASES [ db ] . get ( 'MIGRATE' , True ) : return False custom_routing = settings . CUSTOM_DB_ROUTING if app_label in custom_routing : db_alias = custom_routing [ app_label ] if db_alias not in settings . DATABASES : db_alias = get_db_alias_or_none ( db_alias ) return bool ( db_alias and db_alias == db ) if app_label == SYNCLOGS_APP : return db == settings . SYNCLOGS_SQL_DB_ALIAS if not settings . USE_PARTITIONED_DATABASE : return app_label not in ( PROXY_APP , PROXY_STANDBY_APP ) and db in ( DEFAULT_DB_ALIAS , None ) if app_label == PROXY_APP : return ( db == plproxy_config . proxy_db or bool ( plproxy_standby_config and db == plproxy_standby_config . proxy_db ) ) if app_label == PROXY_STANDBY_APP : return bool ( plproxy_standby_config and db == plproxy_standby_config . proxy_db ) elif app_label == BLOB_DB_APP and db == DEFAULT_DB_ALIAS : return True elif app_label == BLOB_DB_APP and model_name == 'blobexpiration' : return False elif app_label in ( FORM_PROCESSOR_APP , SCHEDULING_PARTITIONED_APP , BLOB_DB_APP ) : return ( db == plproxy_config . proxy_db or db in plproxy_config . form_processing_dbs or bool ( plproxy_standby_config and db == plproxy_standby_config . proxy_db ) ) elif app_label == SQL_ACCESSORS_APP : return db in plproxy_config . form_processing_dbs else : return db in ( DEFAULT_DB_ALIAS , None )