Rename migration

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-04-13 18:21:36 +04:00
parent 36062310be
commit 01ca89de4a
3 changed files with 4 additions and 28 deletions

View File

@@ -376,32 +376,6 @@ func (s *Service) GetActiveCookieBanner(
return &banner, nil
}
func (s *Service) GetActiveCookieBannerByOrigin(
ctx context.Context,
origin string,
) (*coredata.CookieBanner, error) {
var banner coredata.CookieBanner
err := s.pg.WithConn(
ctx,
func(ctx context.Context, conn pg.Querier) error {
if err := banner.LoadActiveByOrigin(ctx, conn, CanonicalizeOrigin(origin)); err != nil {
if errors.Is(err, coredata.ErrResourceNotFound) {
return ErrBannerNotFound
}
return fmt.Errorf("cannot load cookie banner: %w", err)
}
return nil
},
)
if err != nil {
return nil, err
}
return &banner, nil
}
func (s *Service) ListCookieBannersForOrganization(
ctx context.Context,
scope coredata.Scoper,

View File

@@ -13,4 +13,4 @@
-- PERFORMANCE OF THIS SOFTWARE.
CREATE UNIQUE INDEX idx_cookie_banners_unique_active_origin
ON cookie_banners (tenant_id, origin) WHERE state = 'ACTIVE';
ON cookie_banners (tenant_id, origin) WHERE state = 'ACTIVE'::cookie_banner_state;