Loading django/contrib/gis/utils/layermapping.py +3 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,8 @@ from django.contrib.gis.gdal import ( SpatialReference, ) from django.contrib.gis.gdal.field import ( OFTDate, OFTDateTime, OFTInteger, OFTReal, OFTString, OFTTime, OFTDate, OFTDateTime, OFTInteger, OFTInteger64, OFTReal, OFTString, OFTTime, ) from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist from django.db import connections, models, router, transaction Loading Loading @@ -60,6 +61,7 @@ class LayerMapping(object): # counterparts. FIELD_TYPES = { models.AutoField: OFTInteger, models.BigAutoField: OFTInteger64, models.IntegerField: (OFTInteger, OFTReal, OFTString), models.FloatField: (OFTInteger, OFTReal), models.DateField: OFTDate, Loading django/db/backends/base/schema.py +1 −1 Original line number Diff line number Diff line Loading @@ -261,7 +261,7 @@ class BaseDatabaseSchemaEditor(object): definition, )) # Autoincrement SQL (for backends with post table definition variant) if field.get_internal_type() == "AutoField": if field.get_internal_type() in ("AutoField", "BigAutoField"): autoinc_sql = self.connection.ops.autoinc_sql(model._meta.db_table, field.column) if autoinc_sql: self.deferred_sql.extend(autoinc_sql) Loading django/db/backends/mysql/base.py +1 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): # If a column type is set to None, it won't be included in the output. _data_types = { 'AutoField': 'integer AUTO_INCREMENT', 'BigAutoField': 'bigint AUTO_INCREMENT', 'BinaryField': 'longblob', 'BooleanField': 'bool', 'CharField': 'varchar(%(max_length)s)', Loading django/db/backends/mysql/introspection.py +6 −2 Original line number Diff line number Diff line Loading @@ -38,8 +38,12 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): def get_field_type(self, data_type, description): field_type = super(DatabaseIntrospection, self).get_field_type(data_type, description) if field_type == 'IntegerField' and 'auto_increment' in description.extra: if 'auto_increment' in description.extra: if field_type == 'IntegerField': return 'AutoField' elif field_type == 'BigIntegerField': return 'BigAutoField' return field_type def get_table_list(self, cursor): Loading django/db/backends/oracle/base.py +1 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): # output (the "qn_" prefix is stripped before the lookup is performed. data_types = { 'AutoField': 'NUMBER(11)', 'BigAutoField': 'NUMBER(19)', 'BinaryField': 'BLOB', 'BooleanField': 'NUMBER(1)', 'CharField': 'NVARCHAR2(%(max_length)s)', Loading Loading
django/contrib/gis/utils/layermapping.py +3 −1 Original line number Diff line number Diff line Loading @@ -15,7 +15,8 @@ from django.contrib.gis.gdal import ( SpatialReference, ) from django.contrib.gis.gdal.field import ( OFTDate, OFTDateTime, OFTInteger, OFTReal, OFTString, OFTTime, OFTDate, OFTDateTime, OFTInteger, OFTInteger64, OFTReal, OFTString, OFTTime, ) from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist from django.db import connections, models, router, transaction Loading Loading @@ -60,6 +61,7 @@ class LayerMapping(object): # counterparts. FIELD_TYPES = { models.AutoField: OFTInteger, models.BigAutoField: OFTInteger64, models.IntegerField: (OFTInteger, OFTReal, OFTString), models.FloatField: (OFTInteger, OFTReal), models.DateField: OFTDate, Loading
django/db/backends/base/schema.py +1 −1 Original line number Diff line number Diff line Loading @@ -261,7 +261,7 @@ class BaseDatabaseSchemaEditor(object): definition, )) # Autoincrement SQL (for backends with post table definition variant) if field.get_internal_type() == "AutoField": if field.get_internal_type() in ("AutoField", "BigAutoField"): autoinc_sql = self.connection.ops.autoinc_sql(model._meta.db_table, field.column) if autoinc_sql: self.deferred_sql.extend(autoinc_sql) Loading
django/db/backends/mysql/base.py +1 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): # If a column type is set to None, it won't be included in the output. _data_types = { 'AutoField': 'integer AUTO_INCREMENT', 'BigAutoField': 'bigint AUTO_INCREMENT', 'BinaryField': 'longblob', 'BooleanField': 'bool', 'CharField': 'varchar(%(max_length)s)', Loading
django/db/backends/mysql/introspection.py +6 −2 Original line number Diff line number Diff line Loading @@ -38,8 +38,12 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): def get_field_type(self, data_type, description): field_type = super(DatabaseIntrospection, self).get_field_type(data_type, description) if field_type == 'IntegerField' and 'auto_increment' in description.extra: if 'auto_increment' in description.extra: if field_type == 'IntegerField': return 'AutoField' elif field_type == 'BigIntegerField': return 'BigAutoField' return field_type def get_table_list(self, cursor): Loading
django/db/backends/oracle/base.py +1 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): # output (the "qn_" prefix is stripped before the lookup is performed. data_types = { 'AutoField': 'NUMBER(11)', 'BigAutoField': 'NUMBER(19)', 'BinaryField': 'BLOB', 'BooleanField': 'NUMBER(1)', 'CharField': 'NVARCHAR2(%(max_length)s)', Loading