Skip to content

Create ft_service_stats table#4910

Open
DilwoarH wants to merge 1 commit into
add-ft-service-stats-db-updates-3from
add-ft-service-stats-db-updates-4
Open

Create ft_service_stats table#4910
DilwoarH wants to merge 1 commit into
add-ft-service-stats-db-updates-3from
add-ft-service-stats-db-updates-4

Conversation

@DilwoarH

@DilwoarH DilwoarH commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

What

Add migration to create ft_service_stats table with relevant indexes

Why

We need the ft_service_stats table to store the count of statuses

@klssmith klssmith left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just making a note of the things we chatted about, one thing we could consider is to use a composite primary key, matching what we do with the existing ft tables, which means the ID column isn't necessary and it will automatically get a unique index.

We also don't want test notifications to show up on the dashboard, so unless we're specifically not writing test notifications to the new table, might need to add a column for key_type so we can filter these out

sa.Column("template_id", postgresql.UUID(as_uuid=True), nullable=False),
sa.Column("notification_type", postgresql.ENUM(name="notification_type", create_type=False), nullable=False),
sa.Column("notification_status", sa.Text(), nullable=False),
sa.Column("date", sa.Date(), nullable=False, server_default=sa.text("CURRENT_DATE")),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the date in BST, we probably don't want this default since it won't be in BST. It could help avoid confusion or misunderstandings to call the column bst_date too, like we do for ft_notification_status

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