Clean up schema for table approver_groups

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

  • Close this issue

From https://gitlab.com/gitlab-com/infrastructure/issues/1709 (private to GitLab employees):

  • Wrong data type: created_at should be timestamptz
  • Wrong data type: updated_at should be timestamptz
  • "Polymorphic" table prevents regular FKs, use triggers or change to independent columns or non-polymorphic tables
  • Missing constraint: created_at NOT NULL
  • Missing constraint: updated_at NOT NULL

We should replace target_type and target_id with merge_request_id and project_id, both with a foreign key to the right table. We also need to add a Rails validation that ensures only one of the two can be set for every row.

Edited Sep 13, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading