Clean up schema for table oauth_access_tokens

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: revoked_at should be timestamptz
  • Wrong data type: token should be bytea, save 4 MB
  • Wrong data type: refresh_token should be bytea, save 4 MB
  • Missing FK: resource_owner_id -> users (1131 entries violate this rule)
  • Duplicate data: scopes could be an enum or 4-byte integer, save 535 KB
  • Data retention- once revoked, does it make sense to retain?
  • Questionable constraint- token is required to be unique, what happens if it isn't?
  • Questionable constraint- refresh_token is required to be unique, what happens if it isn't?
Edited Sep 13, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading