# OperationalError where it says that column userprofile\_id and id are incompatible. Any suggestions?

**URL:** <https://community.auth0.com/t/operationalerror-where-it-says-that-column-userprofile-id-and-id-are-incompatible-any-suggestions/80231>\
**Category:** Get Help\
**Tags:** mysql, django, api, login, auth0\
**Created:** [March 21, 2022, 8:21am UTC](https://community.auth0.com/t/operationalerror-where-it-says-that-column-userprofile-id-and-id-are-incompatible-any-suggestions/80231 "2022-03-21T08:21:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![monhelle](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/monhelle/32/26690_2.png) [@monhelle](https://community.auth0.com/u/monhelle)\
**Post date:** [March 21, 2022, 8:21am UTC](https://community.auth0.com/t/operationalerror-where-it-says-that-column-userprofile-id-and-id-are-incompatible-any-suggestions/80231/1 "2022-03-21T08:21:07Z")

</div>

Hello  
I am trying to set up authorization through django api. I am also using machine to machine since I am going to set it up with BankID.

> **[Auth0 Django API SDK Quickstarts: Authorization](https://auth0.com/docs/quickstart/backend/django/01-authorization)**
>
> This tutorial demonstrates how to add authorization to a Django REST Framework API.

I have followed the documentation step by step and made sure I am logged in meanwhile, so the issuer and the audience is correct. However, I get this error when trying to run python manage.py migrate

I am using mysql as database  
django.db.utils.OperationalError: (3780, “Referencing column ‘userprofile\_id’ and referenced column ‘id’ in foreign key constraint ‘profiles\_api\_userpro\_userprofile\_id\_c88d1a82\_fk\_profiles\_’ are incompatible.”)

Any suggestions as to why?

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 21, 2022, 8:49am UTC](https://community.auth0.com/t/operationalerror-where-it-says-that-column-userprofile-id-and-id-are-incompatible-any-suggestions/80231/2 "2022-03-21T08:49:07Z")

</div>

Hey there @monhelle!

The most effective way to handle that I believe would be to raise a GitHub issue in the quickstart repo here:

> **[Issues · auth0-samples/auth0-django-api](https://github.com/auth0-samples/auth0-django-api/issues)**
>
> Auth0 Integration Samples for Django REST API Services - Issues · auth0-samples/auth0-django-api

Once you have a link to it you can share it here so we can ping the repo maintainers. Thanks!

---

<div class="post-metadata">

**Author:** ![monhelle](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/monhelle/32/26690_2.png) [@monhelle](https://community.auth0.com/u/monhelle)\
**Post date:** [March 21, 2022, 9:36am UTC](https://community.auth0.com/t/operationalerror-where-it-says-that-column-userprofile-id-and-id-are-incompatible-any-suggestions/80231/3 "2022-03-21T09:36:13Z")

</div>

Thanks konrad! I think I found out the solution luckily. I changed the id to TextField instead of Bigint, now it works

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 21, 2022, 9:45am UTC](https://community.auth0.com/t/operationalerror-where-it-says-that-column-userprofile-id-and-id-are-incompatible-any-suggestions/80231/4 "2022-03-21T09:45:38Z")

</div>

Perfect! Glad to hear that!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 21, 2022, 9:45am UTC](https://community.auth0.com/t/operationalerror-where-it-says-that-column-userprofile-id-and-id-are-incompatible-any-suggestions/80231/5 "2022-03-21T09:45:43Z")

</div>


