Create migrations and model changes for filtering group level audit events by projects and groups

Database schema

Previous suggesion

Create following 2 tables for storing the information related to the filter added:

  1. audit_events_streaming_group_http_group_filter
    1. Attributes:
      1. external_audit_event_destination_id
      2. namespace_id (group_id)
    2. Deletion of row if the corresponding destination or group gets deleted.
    3. Composite unique index on external_audit_event_destination_id and namespace_id columns.
  2. audit_events_streaming_group_http_project_filter
    1. Attributes:
      1. external_audit_event_destination_id
      2. project_id
    2. Deletion of row if the corresponding destination or project gets deleted.
    3. Composite unique index on external_audit_event_destination_id and project_id columns.

Actual implementation

We have moved to a single table as using namespaces(group and project) is what some teams are working towards, so the new database schema is:

  1. audit_events_streaming_http_group_namespace_filters
    1. Attributes:
      1. external_audit_event_destination_id
      2. namespace_id (for group and project namespace)
      • Deletion of row if the corresponding destination or namespace gets deleted.
      • Unique indexes on external_audit_event_destination_id and namespace_id columns.
Edited Nov 02, 2023 by Hitesh Raghuvanshi
Assignee Loading
Time tracking Loading