Skip to content

Clean up schema for table ci_builds

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

  • Wrong data type: finished_at should be timestamptz
  • Wrong data type: created_at should be timestamptz
  • Wrong data type: updated_at should be timestamptz
  • Wrong data type: started_at should be timestamptz
  • Wrong data type: erased_at should be timestamptz
  • Wrong data type: artifacts_expire_at should be timestamptz
  • Wrong data type: queued_at should be timestamptz
  • Missing FK: user_id -> users
  • Missing FK: project_id -> projects
  • Missing FK: erased_by_id -> users
  • Missing constraint: status NOT NULL (?) (23 entries violate this rule)
  • Missing constraint: commit_id NOT NULL (2 entries violate this rule)
  • Duplicate data: status would be more efficient as an enum or integer (or smaller), save ~163MB
Edited by Yorick Peterse