# Path: django_evolution/tests/utils.py
# def make_generate_constraint_name(connection):
#     """Return a constraint generation function for the given database type.
# 
#     This is used by the test data modules as a convenience to allow
#     for a local version of :py:func:`generate_constraint_name` that doesn't
#     need to be passed a database connection on every call.
# 
#     Args:
#         connection (django.db.backends.base.base.BaseDatabaseWrapper):
#             The database connection.
# 
#     Returns:
#         callable:
#         A version of :py:func:`generate_constraint_name` that doesn't need the
#         ``db_type`` parameter.
#     """
#     return partial(generate_constraint_name, connection)
# 
# def make_generate_index_name(connection):
#     """Return an index generation function for the given database type.
# 
#     This is used by the test data modules as a convenience to allow
#     for a local version of :py:func:`generate_index_name` that doesn't need
#     to be passed a database connection on every call.
# 
#     Args:
#         connection (django.db.backends.base.base.BaseDatabaseWrapper):
#             The database connection.
# 
#     Returns:
#         callable:
#         A version of :py:func:`generate_index_name` that doesn't need the
#         ``db_type`` parameter.
#     """
#     return partial(generate_index_name, connection)
# 
# def make_generate_unique_constraint_name(connection):
#     """Return a constraint generation function for the given database type.
# 
#     This is used by the test data modules as a convenience to allow
#     for a local version of :py:func:`generate_constraint_name` that doesn't
#     need to be passed a database connection on every call.
# 
#     Args:
#         connection (django.db.backends.base.base.BaseDatabaseWrapper):
#             The database connection.
# 
#     Returns:
#         callable:
#         A version of :py:func:`generate_constraint_name` that doesn't need the
#         ``db_type`` parameter.
#     """
#     return partial(generate_unique_constraint_name, connection)


import django
from django_evolution.tests.utils import (make_generate_constraint_name,
                                          make_generate_index_name,
                                          make_generate_unique_constraint_name)
from __future__ import unicode_literals




django_version = django.VERSION[:2]

if django_version >= (2, 0):
    drop_index_sql = 'DROP INDEX IF EXISTS'
else:
    drop_index_sql = 'DROP INDEX'


if django_version < (2, 0) or django_version >= (3, 1):
    DESC = ' DESC'
else:
    DESC = 'DESC'


def add_field(connection):
    """SQL test statements for the AddFieldTests suite.

    Args:
        connection (django.db.backends.base.BaseDatabaseWrapper):
            The connection being tested.

    Returns:
        dict:
        The dictionary of SQL mappings.
    """

# Path: django_evolution/tests/utils.py
# def make_generate_constraint_name(connection):
#     """Return a constraint generation function for the given database type.
# 
#     This is used by the test data modules as a convenience to allow
#     for a local version of :py:func:`generate_constraint_name` that doesn't
#     need to be passed a database connection on every call.
# 
#     Args:
#         connection (django.db.backends.base.base.BaseDatabaseWrapper):
#             The database connection.
# 
#     Returns:
#         callable:
#         A version of :py:func:`generate_constraint_name` that doesn't need the
#         ``db_type`` parameter.
#     """
#     return partial(generate_constraint_name, connection)
# 
# def make_generate_index_name(connection):
#     """Return an index generation function for the given database type.
# 
#     This is used by the test data modules as a convenience to allow
#     for a local version of :py:func:`generate_index_name` that doesn't need
#     to be passed a database connection on every call.
# 
#     Args:
#         connection (django.db.backends.base.base.BaseDatabaseWrapper):
#             The database connection.
# 
#     Returns:
#         callable:
#         A version of :py:func:`generate_index_name` that doesn't need the
#         ``db_type`` parameter.
#     """
#     return partial(generate_index_name, connection)
# 
# def make_generate_unique_constraint_name(connection):
#     """Return a constraint generation function for the given database type.
# 
#     This is used by the test data modules as a convenience to allow
#     for a local version of :py:func:`generate_constraint_name` that doesn't
#     need to be passed a database connection on every call.
# 
#     Args:
#         connection (django.db.backends.base.base.BaseDatabaseWrapper):
#             The database connection.
# 
#     Returns:
#         callable:
#         A version of :py:func:`generate_constraint_name` that doesn't need the
#         ``db_type`` parameter.
#     """
#     return partial(generate_unique_constraint_name, connection)


# Path: django_evolution/tests/db/postgresql.py
import django
from django_evolution.tests.utils import (make_generate_constraint_name,
                                          make_generate_index_name,
                                          make_generate_unique_constraint_name)

from __future__ import unicode_literals




django_version = django.VERSION[:2]

if django_version >= (2, 0):
    drop_index_sql = 'DROP INDEX IF EXISTS'
else:
    drop_index_sql = 'DROP INDEX'


if django_version < (2, 0) or django_version >= (3, 1):
    DESC = ' DESC'
else:
    DESC = 'DESC'


def add_field(connection):
    """SQL test statements for the AddFieldTests suite.

    Args:
        connection (django.db.backends.base.BaseDatabaseWrapper):
            The connection being tested.

    Returns:
        dict:
        The dictionary of SQL mappings.
    """

    generate_constraint_name = make_generate_constraint_name(connection)