Created
May 13, 2009 18:54
-
-
Save bjhess/111206 to your computer and use it in GitHub Desktop.
Adjust your Twitter ID's as they're breaking MySQL's signed INT allocation space
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you really want safety from Twitter blowing up, this will get you | |
# to 18,446,744,073,709,551,615 tweets. (Remember, mediumint is smaller | |
# than int.) (http://dev.mysql.com/doc/refman/4.1/en/numeric-types.html) | |
class AdjustTwitterIdToUnsignedBigint < ActiveRecord::Migration | |
def self.up | |
change_column :twitter_messages, :twitter_id, "bigint unsigned" | |
end | |
def self.down | |
change_column :twitter_messages, :twitter_id, :integer | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This will get you to about 4.3 billion tweets | |
# (http://dev.mysql.com/doc/refman/4.1/en/numeric-types.html) | |
class AdjustTwitterIdToUnsignedInt < ActiveRecord::Migration | |
def self.up | |
change_column :twitter_messages, :twitter_id, "integer unsigned" | |
end | |
def self.down | |
change_column :twitter_messages, :twitter_id, :integer | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment