Akryum / Akryum/graphql-migrate

Check PG version / support for PG v12

未关闭
#203 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
56
派生
9
PR 合并指标
30 天内没有已合并 PR

描述

Hey, I just tried to use this and got this error:
```
{
method: 'raw',
sql: 'select\n' +
' c.conname as "indexName",\n' +
` array_to_string(array_agg(a.attname), ',') as "columnNames",\n` +
' c.consrc as "expression"\n' +
' from\n' +
' pg_class t,\n' +
' pg_constraint c,\n' +
' pg_namespace n,\n' +
' pg_attribute a\n' +
' where\n' +
' c.conrelid = t.oid\n' +
' and n.oid = c.connamespace\n' +
' and a.attrelid = t.oid\n' +
' and a.attnum = ANY(c.conkey)\n' +
" and c.contype = 'c'\n" +
' and t.relname = ?\n' +
' and n.nspname = ?\n' +
' group by\n' +
' t.relname,\n' +
' c.conname,\n' +
' c.consrc;',
bindings: [ 'drink', 'public' ],
options: {},
__knexQueryUid: '7945a2dd-19ff-40b0-9ed5-e8d00d48152f'
}
Error migrating: error: column c.consrc does not exist
at Parser.parseErrorMessage (/my/cool/project/node_modules/pg-protocol/src/parser.ts:325:11)
at Parser.handlePacket (/my/cool/project/node_modules/pg-protocol/src/parser.ts:154:21)
at Parser.parse (/my/cool/project/node_modules/pg-protocol/src/parser.ts:106:30)
at Socket. (/my/cool/project/node_modules/pg-protocol/src/index.ts:7:48)
at Socket.emit (events.js:310:20)
at addChunk (_stream_readable.js:286:12)
at readableAddChunk (_stream_readable.js:268:9)
at Socket.Readable.push (_stream_readable.js:209:10)
at TCP.onStreamRead (internal/stream_base_commons.js:186:23) {
length: 187,
severity: 'ERROR',
code: '42703',
detail: undefined,
hint: 'Perhaps you meant to reference the column "c.conkey" or the column "c.conbin".',
position: '107',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'parse_relation.c',
line: '3377',
routine: 'errorMissingColumn'
}
```
After a little research I noticed this seems to be a problem with the upgrade of postgres v11 -> v12.
Preferably you'd support v12, but it might be better to just check the version to give a more descriptive error message.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。