let query = connection
.createQueryBuilder(Organizations, 'organizations')
.leftJoinAndSelect('organizations.setting', 'organization_setting')
.leftJoinAndSelect('organizations.thumbnail', 'thumbnail')
.innerJoin(OrganizationUser, "organization_user", 'organization_user.organization_id = organizations.id')
.where('organization_user.user_id = :userId', { userId }
在AWS中创建的rds实例。并在node js lambda函数中使用它。 数据库,表和数据是从备份文件填充的。 即使表和列存在也显示错误。
error: { error: column organization_user.organization_id does not exist
at Connection.parseE (/var/task/node_modules/pg/lib/connection.js:606:11)
at Connection.parseMessage (/var/task/node_modules/pg/lib/connection.js:403:19)
at Socket.<anonymous> (/var/task/node_modules/pg/lib/connection.js:123:22)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
at Socket.Readable.push (_stream_readable.js:208:10)
at TCP.onread (net.js:607:20) name: 'error', length: 133, severity: 'ERROR', code: '42703', detail: undefined, hint: undefined, position: '2584', internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: 'parse_relation.c', line: '3293', routine: 'errorMissingColumn' }