From ddd69f5a485069f09792d61947090a328fbe37ca Mon Sep 17 00:00:00 2001 From: Michael Barroco Date: Tue, 4 Feb 2025 13:41:13 +0100 Subject: [PATCH] PR comments --- pkg/scd/store/cockroach/constraints.go | 4 +--- pkg/scd/store/cockroach/subscriptions.go | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/scd/store/cockroach/constraints.go b/pkg/scd/store/cockroach/constraints.go index 9f7fb96ab..dd205054e 100644 --- a/pkg/scd/store/cockroach/constraints.go +++ b/pkg/scd/store/cockroach/constraints.go @@ -142,7 +142,6 @@ func (c *repo) UpsertConstraint(ctx context.Context, s *scdmodels.Constraint) (* %s = $8, %s = $9, %s = transaction_timestamp() - WHERE scd_constraints.%s = $1 RETURNING %s`, constraintFieldsWithoutPrefix, @@ -156,7 +155,6 @@ func (c *repo) UpsertConstraint(ctx context.Context, s *scdmodels.Constraint) (* constraintFieldsWithIndices[7], constraintFieldsWithIndices[8], constraintFieldsWithIndices[9], - constraintFieldsWithIndices[0], constraintFieldsWithPrefix, ) ) @@ -228,7 +226,7 @@ func (c *repo) SearchConstraints(ctx context.Context, v4d *dssmodels.Volume4D) ( COALESCE(starts_at <= $3, true) AND COALESCE(ends_at >= $2, true) - LIMIT $4; + LIMIT $4 `, constraintFieldsWithoutPrefix) ) diff --git a/pkg/scd/store/cockroach/subscriptions.go b/pkg/scd/store/cockroach/subscriptions.go index 9d51f6a74..14b0dcfb9 100644 --- a/pkg/scd/store/cockroach/subscriptions.go +++ b/pkg/scd/store/cockroach/subscriptions.go @@ -194,12 +194,12 @@ func (c *repo) pushSubscription(ctx context.Context, q dsssql.Queryable, s *scdm ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, transaction_timestamp()) ON CONFLICT (%s) DO UPDATE SET %s = $2, - %s = $3::int, + %s = $3, %s = $4, - %s = $5::int, + %s = $5, %s = $6, %s = $7, - %s = $8::bool, + %s = $8, %s = $9, %s = $10, %s = $11,