Skip to content

Change team column to text on coplan_users#81

Merged
HamptonMakes merged 1 commit intouser-enrichmentfrom
team-column-text
Apr 3, 2026
Merged

Change team column to text on coplan_users#81
HamptonMakes merged 1 commit intouser-enrichmentfrom
team-column-text

Conversation

@HamptonMakes
Copy link
Copy Markdown
Collaborator

The team field stores org_chart_nodes names joined with |, which can exceed 255 chars for people with deeply nested org hierarchies (e.g., 11+ nodes). Changes from varchar(255) to text to 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.

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>
@HamptonMakes HamptonMakes merged commit e0bae99 into user-enrichment Apr 3, 2026
2 checks passed
@HamptonMakes HamptonMakes deleted the team-column-text branch April 3, 2026 21:19
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant