Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change user_ids from integers to strings #125

Open
anandaroop opened this issue Aug 1, 2017 · 0 comments
Open

Change user_ids from integers to strings #125

anandaroop opened this issue Aug 1, 2017 · 0 comments

Comments

@anandaroop
Copy link
Member

While investigating https://github.com/artsy/gravity/issues/11189 I noticed something that hadn't caught my attention before.

In the db schema for Rosalind, the user_id field in the BatchUpdate model is defined as an integer, whereas it would need to be a string to accommodate the BSON ids coming from Gravity.

Since it's been defined as an integer the BSON ids are being truncated in the database, e.g.:

"548102be7261692d4ca00500" → 548102

(This is exactly analagous to the fix in 69ee68e, and I should have noticed that user_id would have been affected too)

I think the solution is pretty simple. We will

  • migrate the data type for that column
  • then replace the truncated IDs with the full ones

Luckily only a handful of users account for the ~200 batch updates that have been performed so far, so coming up with the mapping shouldn't be too hard.

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

No branches or pull requests

1 participant