Merge pull request #6563 from Budibase/bug/sev2/generate-select-statement-null-pointer-fix
Don't try to check externalType of related tables
This commit is contained in:
commit
2ab15119f4
|
@ -99,8 +99,12 @@ function generateSelectStatement(
|
|||
const fieldNames = field.split(/\./g)
|
||||
const tableName = fieldNames[0]
|
||||
const columnName = fieldNames[1]
|
||||
if (columnName && knex.client.config.client === SqlClients.POSTGRES) {
|
||||
const externalType = schema?.[columnName].externalType
|
||||
if (
|
||||
columnName &&
|
||||
schema?.[columnName] &&
|
||||
knex.client.config.client === SqlClients.POSTGRES
|
||||
) {
|
||||
const externalType = schema[columnName].externalType
|
||||
if (externalType?.includes("money")) {
|
||||
return knex.raw(
|
||||
`"${tableName}"."${columnName}"::money::numeric as "${field}"`
|
||||
|
|
Loading…
Reference in New Issue