import re


def _transform_file_name_to_migration_name(name):
    """extracts from filename migration name

    :param name: filename
    :type name: string
    :returns: Transformed filename
    :rtype: string
    """

    return re.sub(r'\.(up|down)\.sql$', '', name)