Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Error when updating relational field #13379

Closed
terion-name opened this issue May 18, 2022 · 1 comment
Closed

Error when updating relational field #13379

terion-name opened this issue May 18, 2022 · 1 comment

Comments

@terion-name
Copy link

Describe the Bug

In continuation of #13369 (relational structure is there): because of relation duplication bug, decided to make models immutable. Added a condition to relational field and got:

[INTERNAL_SERVER_ERROR] alter table `order_slots` modify `item` int - UNKNOWN_CODE_PLEASE_REPORT: Referencing column 'item' and referenced column 'id' in foreign key constraint 'order_slots_item_foreign' are incompatible.

To Reproduce

See screencast:

screencast.2022-05-18.13-40-48.mp4

Errors Shown

[INTERNAL_SERVER_ERROR] alter table order_slots modify item int - UNKNOWN_CODE_PLEASE_REPORT: Referencing column 'item' and referenced column 'id' in foreign key constraint 'order_slots_item_foreign' are incompatible.

What version of Directus are you using?

9.10.0

What version of Node.js are you using?

v16.14.0

What database are you using?

mysql

What browser are you using?

brave

How are you deploying Directus?

locally

@rijkvanzanten rijkvanzanten changed the title On relational field properties update: [INTERNAL_SERVER_ERROR] alter table order_slots modify item int - UNKNOWN_CODE_PLEASE_REPORT: Referencing column 'item' and referenced column 'id' in foreign key constraint 'order_slots_item_foreign' are incompatible. On relational field properties update: [INTERNAL_SERVER_ERROR] alter table order_slots modify item int - UNKNOWN_CODE_PLEASE_REPORT: Referencing column 'item' and referenced column 'id' in foreign key constraint 'order_slots_item_foreign' are incompatible. May 24, 2022
@rijkvanzanten rijkvanzanten changed the title On relational field properties update: [INTERNAL_SERVER_ERROR] alter table order_slots modify item int - UNKNOWN_CODE_PLEASE_REPORT: Referencing column 'item' and referenced column 'id' in foreign key constraint 'order_slots_item_foreign' are incompatible. On relational field properties update: `[INTERNAL_SERVER_ERROR] alter table order_slots modify item int - UNKNOWN_CODE_PLEASE_REPORT: Referencing column 'item' and referenced column 'id' in foreign key constraint 'order_slots_item_foreign' are incompatible.` May 24, 2022
@rijkvanzanten rijkvanzanten changed the title On relational field properties update: `[INTERNAL_SERVER_ERROR] alter table order_slots modify item int - UNKNOWN_CODE_PLEASE_REPORT: Referencing column 'item' and referenced column 'id' in foreign key constraint 'order_slots_item_foreign' are incompatible.` Error when updating relational field May 24, 2022
@rijkvanzanten
Copy link
Member

Could you confirm that the collation is the same across all tables that are used in this relationship? It reminds me of #9897 which was inherently caused by the referencing table being of a different collation in MySQL.

@directus directus locked and limited conversation to collaborators May 26, 2022
@rijkvanzanten rijkvanzanten converted this issue into discussion #13584 May 26, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants