Closed mshiner closed 2 years ago
This issue has been automatically marked as stale because it has not had recent activity.
Any movement on this ? Its a big issue for to use Budibase against our uzERP database
Martyn
I've changed this to a bug. As it turns out, the problem is that Knex returns a string for bigint types (probably because the max number size in JavaScript isn't large enough), and returns a number of smallint / int types.
When it comes to the relationship match, because it's a precise equality, it is not picking up the relationship, e.g. 1 !== '1'
I'll get a PR out for the fix.
Mel
Great stuff - we've been doing some stuff with BB but TBH this was a major block for us. Good news that there may be a fix on the horizon.
Cheers M
Describe the feature request When setting up relationships the foreign keys do not resolve if the column types do not match. The specific use case was where the master table had a primamry key of type bigint but in the detail table the linking column was defined as type integer.
In postgreSQL the catalogs handle this and the FKs resolve gracefully with no problem.
As per the comment @melohagan in this discussion it would be great if implicit and/or explicit casts could be handled
Screenshots See discussion for more information.