fix: expand token column size and fix composite index exceeding MySQL limit - #21
Merged
Conversation
… limit - Increase Token from varchar(255) to varchar(512) to accommodate longer push tokens - Remove Token from idx_vault_party unique index; composite (vault_id, party_name, token) with utf8mb4 exceeded MySQL's 3072-byte InnoDB index limit - Unique constraint is now (vault_id, party_name) with a separate regular index on token - Update RegisterDevice upsert to conflict on (vault_id, party_name) and update token on re-registration Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdjusted GORM column type constraints in Changes
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- PartyName: varchar(255) -> varchar(128) - Token: restored to uniqueIndex:idx_vault_party (removed separate idx_token) - DeviceType: varchar(255) -> varchar(64) - Combined index (64+128+512)*4 = 2816 bytes, within MySQL's 3072-byte limit Co-Authored-By: Claude Sonnet 4.6 <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.
Summary
Tokenfield fromvarchar(255)tovarchar(512)to accommodate longer FCM/APNs/web push tokensTokenfrom theidx_vault_partycomposite unique index — the combined(vault_id[255], party_name[255], token[512])with utf8mb4 encoding totals 4088 bytes, exceeding MySQL InnoDB's 3072-byte index limit(vault_id, party_name)with a separate regular indexidx_tokenon the token columnRegisterDeviceupsert to conflict on(vault_id, party_name)and includetokeninDoUpdates, so re-registration with a new push token updates the existing recordTest plan
DROP INDEX idx_vault_partycall handles the transition)FindDeviceByTokenand unregister operations still work correctly🤖 Generated with Claude Code
Summary by CodeRabbit