Add organization_id as sharding key for authentication_events table

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Background

The authentication_events table currently has a user_id column, but it's nullable and therefore not suitable as a sharding key. We need to add an organization_id column to properly support organization-level data sharding.

Tasks

  1. Add organization_id column to authentication_events table
  2. Backfill the organization_id data
  3. Update gitlab_schema to gitlab_main_cell
  4. Add organization_id as the sharding key

Technical Details

  • Target table: authentication_events
  • New column: organization_id
  • Schema: gitlab_main_cell
  • Sharding key: organization_id

Acceptance Criteria

  • organization_id column exists in authentication_events table
  • Data is properly backfilled
  • Column is set as not nullable
  • Foreign key constraints are in place
  • Sharding key is properly configured in schema definition
  • All existing functionality works as expected

References

Edited by 🤖 GitLab Bot 🤖