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

Add native support for UUID data type #134

Closed
MohammedBajuaifer opened this issue May 24, 2022 · 7 comments · Fixed by #329
Closed

Add native support for UUID data type #134

MohammedBajuaifer opened this issue May 24, 2022 · 7 comments · Fixed by #329

Comments

@MohammedBajuaifer
Copy link

MohammedBajuaifer commented May 24, 2022

I keep getting this error [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Conversion failed when converting from a character string to uniqueidentifier.

And the problem is because mssql-django does not use uniqueidentifier as the data type for UUIDFields,

I change the has_native_uuid_field to True and it's working. Also created a PR #135

Is there any reason to why this is not support by default?

@jmah8
Copy link
Contributor

jmah8 commented May 24, 2022

The reason this is not supported by default is because mssql-django uses char(32) not uniqueidentifier as the UUIDField which can be seen in

'UUIDField': 'char(32)',

By just changing the has_native_uuid_field to True it causes some unit test to fail, which is why PR #135 is failing the pipeline.

@XF-FW
Copy link

XF-FW commented Nov 16, 2022

Any interest here?

My use-case, is that django is not the only application touching the database and it's not handling the migrations at all (however they're used in testing and development). My workaround is to use a charfield, which is less than satisfying.

Tagging #40, since it's related to this.

@ryancheley
Copy link

I have a similar situation to @XF-FW and would really like to see native support for UUID.

@DrMeosch
Copy link

It would be really nice to have it implemented. Are there any plans, guys?

@dauinsight
Copy link
Contributor

Hi @DrMeosch , we will be reinvestigating the scope of work here and update you on our findings. Thank you

@dauinsight
Copy link
Contributor

We're planning to have native support for UUID's in the next release. Thanks everyone for chiming in

@dauinsight dauinsight linked a pull request Feb 6, 2024 that will close this issue
@nils-van-zuijlen
Copy link

These changes were reverted because of #363. Could you reopen the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants