Clean up schema for table oauth_access_grants
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
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
- Duplicate data: redirect_uri is repeated a lot, could be another table, save 4 MB
- Duplicate data: scopes could be an enum or 4-byte integer, save 535 KB
- Missing FK: resource_owner_id -> users (983 entries violate this rule)
- Data retention- once revoked, does it make sense to retain?
- Questionable constraint- token is required to be unique, what happens if it isn't?
Edited by 🤖 GitLab Bot 🤖