Change team column to text on coplan_users#81
Conversation
The team field stores org_chart_nodes joined with ' | ', which can exceed 255 chars for people with deeply nested org hierarchies. Change from varchar(255) to text to avoid truncation. Amp-Thread-ID: https://ampcode.com/threads/T-019d5512-8c39-741d-aea6-1cb67a6741c2 Co-authored-by: Amp <amp@ampcode.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7bd593bd77
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| end | ||
|
|
||
| def down | ||
| change_column :coplan_users, :team, :string |
There was a problem hiding this comment.
Make rollback resilient to long team values
The down migration narrows coplan_users.team back to string (VARCHAR(255)), but this migration exists specifically because real team paths now exceed 255 chars. In MySQL strict mode, rolling back after any long value is written will fail with Data too long, which can block an emergency deploy rollback. Consider making down explicitly irreversible or truncating/cleaning oversized rows before the type change so rollback can complete predictably.
Useful? React with 👍 / 👎.
The
teamfield storesorg_chart_nodesnames joined with|, which can exceed 255 chars for people with deeply nested org hierarchies (e.g., 11+ nodes). Changes fromvarchar(255)totextto avoid truncation.Discovered during People API full sync in coplan-square — 3 out of ~10k users failed with
Data too long for column 'team'.Depends on #78.