Add ft service stats db updates#4881
Open
DilwoarH wants to merge 3 commits into
Open
Conversation
863c080 to
b4b9050
Compare
…nd create replica identity index
…ation status counts
b4b9050 to
71e9afa
Compare
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 pull request introduces several database migrations focused on improving notification tracking and reporting. The main changes include creating a new
ft_service_statstable for aggregated notification statistics, enforcing data consistency and indexing on thenotificationstable, and setting up logical replication support.Database schema and migration improvements:
Creation of notification statistics table:
ft_service_statstable to store aggregated counts of notification statuses by service, template, notification type, and status. This includes appropriate foreign keys, a unique constraint on the dimension columns, and several indexes to support efficient queries.ft_service_stats.Notification table indexing and constraints:
NOT NULLon thenotification_statuscolumn in thenotificationstable.idandnotification_statusfor thenotificationstable, and set it as the replica identity for logical replication.Logical replication support:
notify_dashboard_replication_slotusing thewal2jsonoutput plugin, with corresponding downgrade logic.