Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
fix: sql project id (#15202)
p0ny8ea8d2c575de
diff --git a/backend/store/changelist.go b/backend/store/changelist.goindex 2fbaf510ab..90c0961bef 100644--- a/backend/store/changelist.go+++ b/backend/store/changelist.go@@ -61,7 +61,7 @@ func (s *Store) ListChangelists(ctx context.Context, find *FindChangelistMessagewhere, args := []string{"TRUE"}, []any{}if v := find.ProjectID; v != nil {- where, args = append(where, fmt.Sprintf("project.resource_id = $%d", len(args)+1)), append(args, *v)+ where, args = append(where, fmt.Sprintf("changelist.project = $%d", len(args)+1)), append(args, *v)}if v := find.ResourceID; v != nil {where, args = append(where, fmt.Sprintf("changelist.name = $%d", len(args)+1)), append(args, *v)@@ -208,8 +208,7 @@ func (s *Store) DeleteChangelist(ctx context.Context, projectID, resourceID striif _, err := tx.ExecContext(ctx, `DELETE FROM changelist- USING project- WHERE changelist.project_id = project.id AND project.resource_id = $1 AND changelist.name = $2;`,+ WHERE changelist.project = $1 AND changelist.name = $2;`,projectID, resourceID); err != nil {return err}diff --git a/backend/store/pipeline.go b/backend/store/pipeline.goindex ea0c2a1ae4..5e63dc3e2e 100644--- a/backend/store/pipeline.go+++ b/backend/store/pipeline.go@@ -224,7 +224,7 @@ func (s *Store) ListPipelineV2(ctx context.Context, find *PipelineFind) ([]*Pipewhere, args = append(where, fmt.Sprintf("pipeline.id = $%d", len(args)+1)), append(args, *v)}if v := find.ProjectID; v != nil {- where, args = append(where, fmt.Sprintf("project.resource_id = $%d", len(args)+1)), append(args, *v)+ where, args = append(where, fmt.Sprintf("pipeline.project = $%d", len(args)+1)), append(args, *v)}query := fmt.Sprintf(`SELECTdiff --git a/backend/store/plan.go b/backend/store/plan.goindex f7708c7bb6..e4a4819682 100644--- a/backend/store/plan.go+++ b/backend/store/plan.go@@ -130,10 +130,10 @@ func (s *Store) ListPlans(ctx context.Context, find *FindPlanMessage) ([]*PlanMewhere, args = append(where, fmt.Sprintf("plan.id = $%d", len(args)+1)), append(args, *v)}if v := find.ProjectID; v != nil {- where, args = append(where, fmt.Sprintf("project.resource_id = $%d", len(args)+1)), append(args, *v)+ where, args = append(where, fmt.Sprintf("plan.project = $%d", len(args)+1)), append(args, *v)}if v := find.ProjectIDs; v != nil {- where, args = append(where, fmt.Sprintf("project.resource_id = ANY($%d)", len(args)+1)), append(args, *v)+ where, args = append(where, fmt.Sprintf("plan.project = ANY($%d)", len(args)+1)), append(args, *v)}if v := find.PipelineID; v != nil {where, args = append(where, fmt.Sprintf("plan.pipeline_id = $%d", len(args)+1)), append(args, *v)