2006-05-02 09:31:56 +08:00
|
|
|
DATA_TYPES = {
|
|
|
|
'AutoField': 'int IDENTITY (1, 1)',
|
|
|
|
'BooleanField': 'bit',
|
2007-08-05 13:14:46 +08:00
|
|
|
'CharField': 'varchar(%(max_length)s)',
|
|
|
|
'CommaSeparatedIntegerField': 'varchar(%(max_length)s)',
|
2006-05-02 09:31:56 +08:00
|
|
|
'DateField': 'smalldatetime',
|
|
|
|
'DateTimeField': 'smalldatetime',
|
2007-05-21 09:29:58 +08:00
|
|
|
'DecimalField': 'numeric(%(max_digits)s, %(decimal_places)s)',
|
2007-09-20 07:33:57 +08:00
|
|
|
'FileField': 'varchar(%(max_length)s)',
|
|
|
|
'FilePathField': 'varchar(%(max_length)s)',
|
2007-05-21 09:29:58 +08:00
|
|
|
'FloatField': 'double precision',
|
2007-09-20 07:33:57 +08:00
|
|
|
'ImageField': 'varchar(%(max_length)s)',
|
2006-05-02 09:31:56 +08:00
|
|
|
'IntegerField': 'int',
|
|
|
|
'IPAddressField': 'char(15)',
|
|
|
|
'NullBooleanField': 'bit',
|
|
|
|
'OneToOneField': 'int',
|
|
|
|
'PhoneNumberField': 'varchar(20)',
|
|
|
|
'PositiveIntegerField': 'int CONSTRAINT [CK_int_pos_%(column)s] CHECK ([%(column)s] > 0)',
|
|
|
|
'PositiveSmallIntegerField': 'smallint CONSTRAINT [CK_smallint_pos_%(column)s] CHECK ([%(column)s] > 0)',
|
2007-08-05 13:14:46 +08:00
|
|
|
'SlugField': 'varchar(%(max_length)s)',
|
2006-05-02 09:31:56 +08:00
|
|
|
'SmallIntegerField': 'smallint',
|
|
|
|
'TextField': 'text',
|
|
|
|
'TimeField': 'time',
|
|
|
|
'USStateField': 'varchar(2)',
|
|
|
|
}
|