mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 02:54:20 +00:00
fix(system-api): use distinct in intances filter query (#6867)
This commit is contained in:
parent
f3b8a3aece
commit
b3ff359fc1
@ -291,7 +291,7 @@ func prepareInstancesQuery(ctx context.Context, db prepareDatabase) (sq.SelectBu
|
||||
return sq.Select(
|
||||
InstanceColumnID.identifier(),
|
||||
countColumn.identifier(),
|
||||
).From(instanceTable.identifier()).
|
||||
).Distinct().From(instanceTable.identifier()).
|
||||
LeftJoin(join(InstanceDomainInstanceIDCol, InstanceColumnID)),
|
||||
func(builder sq.SelectBuilder) sq.SelectBuilder {
|
||||
return sq.Select(
|
||||
|
@ -55,7 +55,7 @@ var (
|
||||
` projections.instance_domains.creation_date,` +
|
||||
` projections.instance_domains.change_date, ` +
|
||||
` projections.instance_domains.sequence` +
|
||||
` FROM (SELECT projections.instances.id, COUNT(*) OVER () FROM projections.instances` +
|
||||
` FROM (SELECT DISTINCT projections.instances.id, COUNT(*) OVER () FROM projections.instances` +
|
||||
` LEFT JOIN projections.instance_domains ON projections.instances.id = projections.instance_domains.instance_id) AS f` +
|
||||
` LEFT JOIN projections.instances ON f.id = projections.instances.id` +
|
||||
` LEFT JOIN projections.instance_domains ON f.id = projections.instance_domains.instance_id` +
|
||||
|
Loading…
Reference in New Issue
Block a user