Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fields to GROUP BY clauses in read_schema function #255

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pkg/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ BEGIN
FROM pg_index pi
JOIN pg_attribute a ON a.attrelid = pi.indrelid AND a.attnum = ANY(pi.indkey)
WHERE indrelid = t.oid::regclass
GROUP BY pi.indexrelid
GROUP BY pi.indexrelid, pi.indisunique
) as ix_details
),
'checkConstraints', (
Expand All @@ -198,7 +198,7 @@ BEGIN
INNER JOIN pg_attribute cc_attr ON cc_attr.attrelid = cc_constraint.conrelid AND cc_attr.attnum = ANY(cc_constraint.conkey)
WHERE cc_constraint.conrelid = t.oid
AND cc_constraint.contype = 'c'
GROUP BY cc_constraint.oid
GROUP BY cc_constraint.oid, cc_constraint.conname
) AS cc_details
),
'uniqueConstraints', (
Expand All @@ -215,7 +215,7 @@ BEGIN
INNER JOIN pg_attribute uc_attr ON uc_attr.attrelid = uc_constraint.conrelid AND uc_attr.attnum = ANY(uc_constraint.conkey)
WHERE uc_constraint.conrelid = t.oid
AND uc_constraint.contype = 'u'
GROUP BY uc_constraint.oid
GROUP BY uc_constraint.oid, uc_constraint.conname
) AS uc_details
),
'foreignKeys', (
Expand Down
Loading