Skip to content

Apply DB-05 duplicate-index drop and promo_redeem_failures primary key as migrations - #218

Merged
Programcode merged 2 commits into
mainfrom
fix/db05-dedupe-indexes-promo-pk
Oct 23, 2026
Merged

Programcode merged 2 commits into
mainfrom
fix/db05-dedupe-indexes-promo-pk

Conversation

@Programcode

Copy link
Copy Markdown
Owner

Adam approved on 23 Oct 2026 (09:18 CEST): run the safe cleanup scripts from supabase/proposed/.

  • 20261023073000_drop_duplicate_indexes.sql (DB-05): drops 6 indexes that duplicate another index. Each drop is guarded, so it runs only if the kept twin exists, is valid and identical. Moved unchanged from supabase/proposed/20261023060200_*; only the header changed.
  • 20261023073100_promo_redeem_failures_primary_key.sql: adds an identity id primary key to private.promo_redeem_failures. redeem_promo_code_atomic inserts only user_id, so it needs no change. Moved from supabase/proposed/20261023060300_*.
  • supabase/proposed/20261023060100_drop_staging_auto_admin.sql (DB-04) is removed. Its header forbids adding it to migrations, so it was run by hand on staging (23 Oct ~09:30 CEST, in a transaction; the definition is backed up off-repo). Production never had the function.
  • DB-03 (legacy policies) stays in proposed/. It was dry-run on staging only (rolled back).

No functions or app code changed. After merge, the staging timer applies the two migrations; production gets supabase db push once staging checks out.

…y as migrations

Adam approved these on 23 Oct 2026. Both move from supabase/proposed/ to
supabase/migrations/ under new timestamps so main and the hosted projects
stay in sync. DB-04 (staging_auto_admin) was run by hand on staging as its
header requires and is removed from proposed/. DB-03 stays proposed.
Copilot AI balanced review requested due to automatic review settings October 23, 2026 07:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 30 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between a7610fa and d734938.

📒 Files selected for processing: 3
  • supabase/migrations/20261023073000_drop_duplicate_indexes.sql
  • supabase/migrations/20261023073100_promo_redeem_failures_primary_key.sql
  • supabase/proposed/20261023060100_drop_staging_auto_admin.sql
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing.

Comment @coderabbitai help to get the list of available commands.

@Programcode

Copy link
Copy Markdown
Owner Author

Verified on the VPS at d734938: npm run verify exit 0 (docs, lint incl. squawk, typecheck, 586 unit, 30 collab, 457 edge, build + check-site 48, test:sw, 47 e2e smoke) and .superset/db-gate.sh --db-only exit 0 (pgTAP 28 files / 516 tests, database scripts; stack stopped). GitHub Actions jobs fail at start (2-3s), as on #209.

@Programcode
Programcode merged commit 731a1a5 into main Oct 23, 2026
3 of 11 checks passed
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.

2 participants