Skip to content

Conversation

@liranbg
Copy link
Member

@liranbg liranbg commented Jan 13, 2026

📝 Description

Continuing the work done by @adamdelman @ #8347


This PR refactors and enhances the database partitioning system for alert activations to improve cross-database compatibility, robustness, and maintainability. The changes establish a cleaner architecture for partition management while adding full PostgreSQL support alongside the existing MySQL implementation.

Key improvements:

  • Cross-database support: Added native PostgreSQL partitioning alongside MySQL, with SQLite gracefully skipping partition operations
  • Explicit partition keys: Introduced a dedicated partition_key integer column computed from activation_time, enabling consistent partitioning logic across databases
  • Partition metadata tracking: New table_partition_interval table persists partition configuration, decoupling interval choice from table structure
  • Improved bootstrapping: Separated partition creation logic into dedicated bootstrapper classes per database dialect
  • Enhanced testing: Comprehensive integration tests for both MySQL and PostgreSQL partition operations

🛠️ Changes Made

  • Integration tests now run against both mysql and postgres backends

✅ Checklist

  • I updated the documentation (if applicable)
  • I have tested the changes in this PR
  • I confirmed whether my changes are covered by system tests
    • If yes, I ran all relevant system tests and ensured they passed before submitting this PR
    • I updated existing system tests and/or added new ones if needed to cover my changes
  • If I introduced a deprecation:

🧪 Testing


🔗 References


🚨 Breaking Changes?

  • Yes (explain below)
  • No

🔍️ Additional Notes

@liranbg liranbg merged commit 02c377a into development Jan 13, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants