Merged
Conversation
This reverts commit 6862902.
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This reverts commit 6862902.