# Path: django_sharding_library/fields.py
# class BigAutoField(AutoField):
#     description = _("Big (8 byte) integer")
# 
#     def db_type(self, connection):
#         if connection.settings_dict['ENGINE'] in Backends.MYSQL:
#             return 'serial'
#         if connection.settings_dict['ENGINE'] in Backends.POSTGRES:
#             return 'bigserial'
#         return super(BigAutoField, self).db_type(connection)
# 
#     def rel_db_type(self, connection):
#         return BigIntegerField().db_type(connection=connection)


from django.conf import settings
from django.db import models
from django_sharding_library.fields import BigAutoField
            settings.DATABASES.keys()
        )
    )


class ShardedByMixin(models.Model):
    """
    This mixin is intended to be used with the included `save_shard_handler` in order
    to save the shard to the object. This is done by registering it on the User's pre-save signal.
    Look at the signal's docstring for additional information.

    Note: requires the use of `cls.shard_group`
    """
    django_sharding__shard_field = 'shard'
    django_sharding__stores_shard = True

    SHARD_CHOICES = ((i, i) for i in _get_primary_shards())

    shard = models.CharField(max_length=120, blank=True, null=True, choices=SHARD_CHOICES)

    class Meta:
        abstract = True


class TableStrategyModel(models.Model):
    """
    A model for use with the TableStrategy in order to generate ids using an
    autoincrimenting field. To use this, simply inherit from this class and give
    the model a more meaningful name e.g. InvoiceIDs.
    """

# Path: django_sharding_library/fields.py
# class BigAutoField(AutoField):
#     description = _("Big (8 byte) integer")
# 
#     def db_type(self, connection):
#         if connection.settings_dict['ENGINE'] in Backends.MYSQL:
#             return 'serial'
#         if connection.settings_dict['ENGINE'] in Backends.POSTGRES:
#             return 'bigserial'
#         return super(BigAutoField, self).db_type(connection)
# 
#     def rel_db_type(self, connection):
#         return BigIntegerField().db_type(connection=connection)


# Path: django_sharding_library/models.py
from django.conf import settings
from django.db import models
from django_sharding_library.fields import BigAutoField

            settings.DATABASES.keys()
        )
    )


class ShardedByMixin(models.Model):
    """
    This mixin is intended to be used with the included `save_shard_handler` in order
    to save the shard to the object. This is done by registering it on the User's pre-save signal.
    Look at the signal's docstring for additional information.

    Note: requires the use of `cls.shard_group`
    """
    django_sharding__shard_field = 'shard'
    django_sharding__stores_shard = True

    SHARD_CHOICES = ((i, i) for i in _get_primary_shards())

    shard = models.CharField(max_length=120, blank=True, null=True, choices=SHARD_CHOICES)

    class Meta:
        abstract = True


class TableStrategyModel(models.Model):
    """
    A model for use with the TableStrategy in order to generate ids using an
    autoincrimenting field. To use this, simply inherit from this class and give
    the model a more meaningful name e.g. InvoiceIDs.
    """

    id = BigAutoField(primary_key=True)