Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restore original uuid behaviour #364

Merged
merged 1 commit into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions mssql/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
'SmallIntegerField': 'smallint',
'TextField': 'nvarchar(max)',
'TimeField': 'time',
'UUIDField': 'uniqueidentifier',
'UUIDField': 'char(32)',
}
data_types_suffix = {
'AutoField': 'IDENTITY (1, 1)',
Expand Down Expand Up @@ -432,9 +432,6 @@ def init_connection_state(self):
if (options.get('return_rows_bulk_insert', False)):
self.features_class.can_return_rows_from_bulk_insert = True

if (options.get('has_native_uuid_field', True)):
Database.native_uuid = True

val = self.get_system_datetime
if isinstance(val, str):
raise ImproperlyConfigured(
Expand Down
2 changes: 1 addition & 1 deletion mssql/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
has_json_object_function = False
has_json_operators = False
has_native_json_field = False
has_native_uuid_field = True
has_native_uuid_field = False
has_real_datatype = True
has_select_for_update = True
has_select_for_update_nowait = True
Expand Down
2 changes: 1 addition & 1 deletion mssql/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def convert_floatfield_value(self, value, expression, connection):

def convert_uuidfield_value(self, value, expression, connection):
if value is not None:
value = uuid.UUID(str(value))
value = uuid.UUID(value)
return value

def convert_booleanfield_value(self, value, expression, connection):
Expand Down
Loading