Geo: Use text limit constraints
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Background
- We sometimes use text limits in migrations: https://gitlab.com/gitlab-org/gitlab/-/blob/2d02e88b1adf6a71c5405e38e70c847bf8a19aa0/ee/db/geo/migrate/20200811171011_create_snippet_repository_registry.rb#L27
- But
ee/db/geo/schema.rbdoesn't appear to record those constraints: https://gitlab.com/gitlab-org/gitlab/-/blob/2d02e88b1adf6a71c5405e38e70c847bf8a19aa0/ee/db/geo/schema.rb#L206
Problem
Therefore it seems like new installs do not have text limits in the tracking DB.
Questions
- How do we align all existing installs?
Proposal
- Open a small MR to modify https://gitlab.com/gitlab-org/gitlab/-/blob/c485d2a0be659c1860008bc78272cdef42efae5e/doc/development/geo/framework.md to define
last_sync_failureas astring/varcharwith a limit, instead of usingadd_text_limit(there are 2 occurrences for the registry table). => !56446 (merged) - Switch to
structure.sql=> #341758 (closed) - Just in case, clear fields if they are over the text limits that we will add in the next step
- Add migrations that create text limit constraints for existing text fields if they don't exist. (I don't think this needs multiple releases since the code is already expected to properly truncate the text before insert/update.)
- Ensure all text fields in
structure.sqlhave limit constraints
Edited by 🤖 GitLab Bot 🤖