Skip to content

claude/revert-latest-commit-ublfD#766

Merged
dylanjeffers merged 1 commit intomainfrom
claude/revert-latest-commit-ublfD
Apr 16, 2026
Merged

claude/revert-latest-commit-ublfD#766
dylanjeffers merged 1 commit intomainfrom
claude/revert-latest-commit-ublfD

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

This reverts commit 6862902.

@dylanjeffers dylanjeffers merged commit e694518 into main Apr 16, 2026
4 checks passed
@dylanjeffers dylanjeffers deleted the claude/revert-latest-commit-ublfD branch April 16, 2026 17:44
dylanjeffers pushed a commit that referenced this pull request Apr 16, 2026
Re-applies #765 (reverted in #766). The original PR's
ddl/migrations/0195_subscriptions_generic_entity.sql wrapped an
ALTER TABLE plus a non-CONCURRENT CREATE INDEX in BEGIN/COMMIT,
holding ACCESS EXCLUSIVE on subscriptions for the full index
build and causing an API outage.

Migration changes:
- Replaced 0195 with 0196_subscriptions_generic_entity.sql.
- Dropped the BEGIN/COMMIT wrapper so CREATE INDEX CONCURRENTLY
  is legal.
- Switched to CREATE INDEX CONCURRENTLY IF NOT EXISTS so writes
  are not blocked during the build.
- Removed the no-op UPDATE that scanned the table while holding
  the exclusive lock.
- All statements use IF NOT EXISTS so prod (where 0195 already
  committed) treats this as a no-op and fresh envs still
  bootstrap correctly.

Trigger change in handle_track.sql:
- Replaced the per-row LOOP that issued one INSERT per follower
  / saver with a single set-based INSERT ... SELECT ... ON
  CONFLICT DO NOTHING. Avoids slow trigger execution for tracks
  whose contest creator has many followers.

Also added subscriptions_entity_type_entity_id_idx to
sql/01_schema.sql so the cumulative dump matches the live schema.
dylanjeffers added a commit that referenced this pull request Apr 16, 2026
Re-applies #765 (reverted in #766). The original PR's
ddl/migrations/0195_subscriptions_generic_entity.sql wrapped an
ALTER TABLE plus a non-CONCURRENT CREATE INDEX in BEGIN/COMMIT,
holding ACCESS EXCLUSIVE on subscriptions for the full index
build and causing an API outage.

Migration changes:
- Replaced 0195 with 0196_subscriptions_generic_entity.sql.
- Dropped the BEGIN/COMMIT wrapper so CREATE INDEX CONCURRENTLY
  is legal.
- Switched to CREATE INDEX CONCURRENTLY IF NOT EXISTS so writes
  are not blocked during the build.
- Removed the no-op UPDATE that scanned the table while holding
  the exclusive lock.
- All statements use IF NOT EXISTS so prod (where 0195 already
  committed) treats this as a no-op and fresh envs still
  bootstrap correctly.

Trigger change in handle_track.sql:
- Replaced the per-row LOOP that issued one INSERT per follower
  / saver with a single set-based INSERT ... SELECT ... ON
  CONFLICT DO NOTHING. Avoids slow trigger execution for tracks
  whose contest creator has many followers.

Also added subscriptions_entity_type_entity_id_idx to
sql/01_schema.sql so the cumulative dump matches the live schema.

Co-authored-by: Claude <noreply@anthropic.com>
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