app/django/db/backends/sqlite3/creation.py
author Pawel Solyga <Pawel.Solyga@gmail.com>
Wed, 01 Oct 2008 19:21:09 +0000
changeset 249 325fb70c61a9
parent 54 03e267d67478
child 323 ff1a9aa48cfd
permissions -rw-r--r--
Replace common module with validate module. Move validation function from feed module to validate module and remove feed.py. Correct any usage of validation functions from common and feed modules into validate module. Patch by: Pawel Solyga Review by: to-be-reviewed

# SQLite doesn't actually support most of these types, but it "does the right
# thing" given more verbose field definitions, so leave them as is so that
# schema inspection is more useful.
DATA_TYPES = {
    'AutoField':                    'integer',
    'BooleanField':                 'bool',
    'CharField':                    'varchar(%(max_length)s)',
    'CommaSeparatedIntegerField':   'varchar(%(max_length)s)',
    'DateField':                    'date',
    'DateTimeField':                'datetime',
    'DecimalField':                 'decimal',
    'FileField':                    'varchar(%(max_length)s)',
    'FilePathField':                'varchar(%(max_length)s)',
    'FloatField':                   'real',
    'ImageField':                   'varchar(%(max_length)s)',
    'IntegerField':                 'integer',
    'IPAddressField':               'char(15)',
    'NullBooleanField':             'bool',
    'OneToOneField':                'integer',
    'PhoneNumberField':             'varchar(20)',
    'PositiveIntegerField':         'integer unsigned',
    'PositiveSmallIntegerField':    'smallint unsigned',
    'SlugField':                    'varchar(%(max_length)s)',
    'SmallIntegerField':            'smallint',
    'TextField':                    'text',
    'TimeField':                    'time',
    'USStateField':                 'varchar(2)',
}