Skip to content

Conversation

@norkans7
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings November 20, 2025 12:59
Copilot finished reviewing on behalf of norkans7 November 20, 2025 13:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a database migration that introduces a check constraint to ensure only one segment field can be set at a time in the stats_pollstats table. The constraint validates that at most one of the four segment fields (age_segment_id, gender_segment_id, location_id, scheme_segment_id) contains a non-null value.

  • Adds a PostgreSQL check constraint using num_nonnulls() function
  • Includes a reverse migration to properly drop the constraint

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.



# language=SQL
CONTRAINT_SQL_POLLSTATS_ONE_SEGMENT_SET_MAX = """
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'CONTRAINT' to 'CONSTRAINT'.

Copilot uses AI. Check for mistakes.
"""

# language=SQL
CONTRAINT_SQL_POLLSTATS_ONE_SEGMENT_SET_MAX_DROP = """
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'CONTRAINT' to 'CONSTRAINT'.

Copilot uses AI. Check for mistakes.
@codecov-commenter
Copy link

codecov-commenter commented Nov 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.94%. Comparing base (3ca2d9c) to head (4277edf).

Additional details and impacted files
@@                   Coverage Diff                    @@
##           fewer-poll-stats-rows-2    #1305   +/-   ##
========================================================
  Coverage                    83.94%   83.94%           
========================================================
  Files                           48       48           
  Lines                         5899     5899           
========================================================
  Hits                          4952     4952           
  Misses                         947      947           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@norkans7 norkans7 marked this pull request as draft November 21, 2025 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants