Skip to content

Commit 4270e22

Browse files
authored
restore original uuid behaviour
2 parents 8a44053 + 8e4e7f2 commit 4270e22

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

mssql/base.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
126126
'SmallIntegerField': 'smallint',
127127
'TextField': 'nvarchar(max)',
128128
'TimeField': 'time',
129-
'UUIDField': 'uniqueidentifier',
129+
'UUIDField': 'char(32)',
130130
}
131131
data_types_suffix = {
132132
'AutoField': 'IDENTITY (1, 1)',
@@ -432,9 +432,6 @@ def init_connection_state(self):
432432
if (options.get('return_rows_bulk_insert', False)):
433433
self.features_class.can_return_rows_from_bulk_insert = True
434434

435-
if (options.get('has_native_uuid_field', True)):
436-
Database.native_uuid = True
437-
438435
val = self.get_system_datetime
439436
if isinstance(val, str):
440437
raise ImproperlyConfigured(

mssql/features.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
2222
has_json_object_function = False
2323
has_json_operators = False
2424
has_native_json_field = False
25-
has_native_uuid_field = True
25+
has_native_uuid_field = False
2626
has_real_datatype = True
2727
has_select_for_update = True
2828
has_select_for_update_nowait = True

mssql/operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def convert_floatfield_value(self, value, expression, connection):
129129

130130
def convert_uuidfield_value(self, value, expression, connection):
131131
if value is not None:
132-
value = uuid.UUID(str(value))
132+
value = uuid.UUID(value)
133133
return value
134134

135135
def convert_booleanfield_value(self, value, expression, connection):

0 commit comments

Comments
 (0)