How to create association if the two keys are of different types

:warning:This is a template you must use to report issues. :warning:
You can also drag images, videos and include Preformatted text.
I have two tables, one of them has userId whose type is varchar and the other one is uuid. I would like to establish a relationship between these two tables, however, I get following error -

2022-03-01T22:07:43.597+05:30 e[31m[forest] :deciduous_tree::deciduous_tree::deciduous_tree: Unexpected error: operator does not exist: uuid = character varyinge[39m

2022-03-01T22:07:43.597+05:30 e[31m{e[39m

2022-03-01T22:07:43.597+05:30 e[31m “name”: “SequelizeDatabaseError”,e[39m

2022-03-01T22:07:43.597+05:30 e[31m “parent”: {e[39m

2022-03-01T22:07:43.597+05:30

Copy
e[31m “length”: 210,e[39m
e[31m “length”: 210,e[39m

2022-03-01T22:07:43.597+05:30 e[31m “name”: “error”,e[39m

2022-03-01T22:07:43.597+05:30 e[31m “severity”: “ERROR”,e[39m

2022-03-01T22:07:43.597+05:30 e[31m “code”: “42883”,e[39m

2022-03-01T22:07:43.597+05:30 e[31m “hint”: “No operator matches the given name and argument types. You might need to add explicit type casts.”,e[39m

2022-03-01T22:07:43.597+05:30 e[31m “position”: “292”,e[39m

2022-03-01T22:07:43.597+05:30 e[31m “file”: “parse_oper.c”,e[39m

2022-03-01T22:07:43.597+05:30 e[31m “line”: “731”,e[39m

2022-03-01T22:07:43.597+05:30 e[31m “routine”: “op_error”,e[39m

I think this error is preventing the dashboard from rendering the related data when a row is selected.

Feature(s) impacted

Please describe in this mandatory section the feature(s) that will be discussed in this topic.
Forest Admin Dashboard

Observed behavior

Please describe in this mandatory section the current behavior you observe.

Expected behavior

Please describe in this mandatory section the behavior you are expecting.

Failure Logs

In this optional section, please:

  • include any relevant log snippets if necessary,
  • or remove this section if left empty.

Context

Please provide in this mandatory section, the relevant information about your configuration:

  • Project name: …Gerald
  • Team name: …
  • Environment name: … Dev
  • Agent type & version: … “forest-express-sequelize”: “^8.5.0”,
    “morgan”: “1.9.1”,
    “pg”: “~8.2.2”,
    “require-all”: “^3.0.0”,
    “sequelize”: “~5.15.1”
  • Recent changes made on your end if any: …

Hi @Nam_B,

Could you please format correctly the stacktrace it’s really not readable right now :sweat_smile:

So first I would strongly suggest you to have the same field type as this is not natural for an SQL database to join on 2 different field types.
Secondly, it’s no linked to Forest :wink:, I’ll let you find help on Sequelizeif there is a way to do so :person_shrugging: