Reputation: 137
I've been running a small web-based experiemnt using Facebook UIDs to verify unique users.
Recently I've discovered that UIDs can be bigger than I realised among some users, so my int-based system is now inadequate and I need to convert to bigint.
I can't risk losing the results I already have, but need to convert the table so that the index containing the uid is now bigint. Are there any particular issues changing the type of an index column, and would it be as simple as:
ALTER TABLE breadusers MODIFY userid bigint;
?
Upvotes: 6
Views: 11304
Reputation: 736
For the Facebook UID part, I would suggest you to go for BIGINT(64). Here is the answer from Facebook Blog: https://developers.facebook.com/blog/post/45/
Upvotes: 0
Reputation: 54425
In theory this should be absolutely fine, although it the data really matters, I presume you have a recent backup anyway in case something goes awry.
That said, I'd probably be tempted to store the Facebook UID as a string (i.e.: in a VARCHAR
field) and simply have a generic auto-incremented ID field. Then again, that's an answer to a different question. :-)
Upvotes: 3