def _convert_schemas(mapping, schemas):
schemas = deepcopy(schemas)<EOL>for schema in schemas:<EOL><INDENT>for fk in schema.get('<STR_LIT>', []):<EOL><INDENT>resource = fk['<STR_LIT>']['<STR_LIT>']<EOL>if resource != '<STR_LIT>':<EOL><INDENT>if resource not in mapping:<EOL><INDENT>message = '<STR_LIT>'<EOL>message = message % (resource, fk)<EOL>raise ValueError(message)<EOL><DEDENT>fk['<STR_LIT>']['<STR_LIT>'] = mapping[resource]<EOL><DEDENT><DEDENT><DEDENT>return schemas<EOL>
Convert schemas to be compatible with storage schemas.

    Foreign keys related operations.

    Args:
        mapping (dict): mapping between resource name and table name
        schemas (list): schemas

    Raises:
        ValueError: if there is no resource
            for some foreign key in given mapping

    Returns:
        list: converted schemas