Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylebragger/123319 to your computer and use it in GitHub Desktop.
Save kylebragger/123319 to your computer and use it in GitHub Desktop.
# 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 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