You'll also need to handle the fact that ids in Rails are automatically incremented so when a user uninstalls the app you won't be able to remove their account (perhaps just mark it as 'disabled' in your application or some similar approach) so when they decide to re-install the app all you have to do is set it to 'enabled' <br>
<br><br><br>-AE<br><br><div class="gmail_quote">On Tue, Nov 11, 2008 at 10:19 AM, Tres Wong-Godfrey <span dir="ltr"><<a href="mailto:tres.wong-godfrey@saniq.com">tres.wong-godfrey@saniq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
As of Rails 2.1 64 bit ints are supported in MySQL migrations. Formerly you needed to use a plugin to get this working in MySQL.<br>
<br>
Rails 2.1.0 had some problems with the implementation, but in 2.1.1 I believe they have fixed the implementation to work the same as Postgres, so using :limit => 8 gets you bigint in mysql.<br>
<br>
So something like this, should work under Rails 2.1.1 with no patching or plugins necessary:<br>
t.integer :facebook_id, :limit => 8, :null=> false<div><div></div><div class="Wj3C7c"><br>
<br>
<br>
<br>
On Nov 11, 2008, at 10:08 AM, Lee Mallabone wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">
2008/11/11 Joseph Durden <<a href="mailto:josephdurden@gmail.com" target="_blank">josephdurden@gmail.com</a>>:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I am new to rails, and was wondering if there would be unknown consequences<br>
for setting the user tables primary key to being the facebook_id of a user.<br>
I have implemented this funcionality, and everything is working fine. All<br>
associations etc. What are the risks if there are any of overridding the id<br>
with facebook_id? Why would I not want to do this?<br>
</blockquote>
<br>
I'm doing this at the moment. The biggest thing I was concerned about<br>
was the potential for facebook user IDs to be 64bit numbers. (I can't<br>
remember the official Facebook stance on ID size but I'm pretty sure<br>
they weren't ruling out 64bit IDs). Rails migrations don't seem to<br>
support 64bit values (on mysql at least) out-of-the-box.<br>
<br>
I worked around the issue by patching ActiveRecord. I added a snippet<br>
(attached) to environment.rb based on the following post and all seems<br>
fine to date:<br>
<a href="http://snippets.dzone.com/posts/show/4422" target="_blank">http://snippets.dzone.com/posts/show/4422</a><br>
<br>
Use column type :int64_pk for your users table and :int64 for any<br>
foreign key columns.<br>
<br>
Lee.<br>
<br>
<br>
<br>
-- <br>
Lee Mallabone.<br>
Director, Crossbone Systems Ltd.<br>
<br>
<a href="http://www.crossbonesystems.com/" target="_blank">http://www.crossbonesystems.com/</a><br>
<a href="http://www.fonicmonkey.net/" target="_blank">http://www.fonicmonkey.net/</a><br>
<a href="http://CambridgeWebHeads.ning.com/" target="_blank">http://CambridgeWebHeads.ning.com/</a><br></div></div><div class="Ih2E3d">
<mysql-64bit-monkeypatch.rb>_______________________________________________<br>
Facebooker-talk mailing list<br>
<a href="mailto:Facebooker-talk@rubyforge.org" target="_blank">Facebooker-talk@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/facebooker-talk" target="_blank">http://rubyforge.org/mailman/listinfo/facebooker-talk</a><br>
</div></blockquote><div><div></div><div class="Wj3C7c">
<br>
_______________________________________________<br>
Facebooker-talk mailing list<br>
<a href="mailto:Facebooker-talk@rubyforge.org" target="_blank">Facebooker-talk@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/facebooker-talk" target="_blank">http://rubyforge.org/mailman/listinfo/facebooker-talk</a><br>
</div></div></blockquote></div><br>