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

Relationship with different types of column #1043

Closed
alexandre-freret opened this issue Jul 19, 2024 · 1 comment
Closed

Relationship with different types of column #1043

alexandre-freret opened this issue Jul 19, 2024 · 1 comment
Assignees

Comments

@alexandre-freret
Copy link

Package version

21.1.0

Describe the bug

Hello,

I have a problem when i used relationship with 2 differents types of columns. The database used is not mine. I recreate 2 tables to explain the problem.

Example :
Table teams:

  • id_varchar (varchar(3))
  • id_char (char(3))
  • name (varchar(250))

Table users:

  • id (int)
  • name (varchar(250))
  • team (char(3))

Capture d’écran 2024-07-19 à 15 26 19

In the teams table, the id_varchar has a space at the end, and it's the problem, when i preload the relationship with the id_char it's works, but when i preload with id_varchar it's doesn't works.
When i execute the query like SELECT * from `teams` where `id_varchar` in ('01', '02') it's works.

Do you have any idea ?
There is a repo with my example code, with the sql too : https://github.com/alexandre-freret/adonis-example

Thanks

Reproduction repo

https://github.com/alexandre-freret/adonis-example

@thetutlage
Copy link
Member

This is not possible at the Lucid level and we might never support it. Sorry, the datatypes have to be the same

@thetutlage thetutlage self-assigned this Jul 23, 2024
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

No branches or pull requests

2 participants