NotificationGroups table
The NotificationGroups table in the FitStack - V2 schema has 18 columns, keyed by Id, with 1 foreign key to Users. 1 column in Notifications references it.
Rollup: "3 people liked your post". Consent notifications must NEVER be grouped — each one is an individual decision.
Columns (18)
| Column | Type | Constraints | Description |
|---|---|---|---|
| Id | uuid | primary key, not null | |
| UserId | text | not null, references Users.Id | |
| Type | text | not null | |
| GroupKey | text | not null | |
| Title | text | not null | |
| Count | integer | not null | |
| IsRead | boolean | not null | |
| ReadAt | timestamp with time zone | ||
| LastNotificationAt | timestamp with time zone | not null | |
| RelatedEntityId | uuid | ||
| RelatedEntityType | text | ||
| ActionUrl | text | ||
| Metadata | text | ||
| ExpiresAt | timestamp with time zone | ||
| CreatedAt | timestamp with time zone | not null | |
| ModifiedAt | timestamp with time zone | ||
| IsDeleted | boolean | not null | |
| DeletedAt | timestamp with time zone |
Indexes (1)
(UserId, GroupKey)unique (IX_NotificationGroups_UserId_GroupKey)
Relationships
NotificationGroups.UserIdreferencesUsers.IdNotifications.NotificationGroupIdreferencesNotificationGroups