From 49b48e1eb6db41c7b13733ed9ddaae0b28ffcfe3 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 22 Nov 2013 17:51:36 +1100 Subject: [PATCH] ensure we have a bigint id --- .../20131122064921_increase_twitter_user_id_length.rb | 5 +++++ spec/models/twitter_user_info_spec.rb | 10 ++++++++++ 2 files changed, 15 insertions(+) create mode 100644 db/migrate/20131122064921_increase_twitter_user_id_length.rb create mode 100644 spec/models/twitter_user_info_spec.rb diff --git a/db/migrate/20131122064921_increase_twitter_user_id_length.rb b/db/migrate/20131122064921_increase_twitter_user_id_length.rb new file mode 100644 index 00000000000..65cb13ce3e1 --- /dev/null +++ b/db/migrate/20131122064921_increase_twitter_user_id_length.rb @@ -0,0 +1,5 @@ +class IncreaseTwitterUserIdLength < ActiveRecord::Migration + def change + change_column :twitter_user_infos, :twitter_user_id, :bigint + end +end diff --git a/spec/models/twitter_user_info_spec.rb b/spec/models/twitter_user_info_spec.rb new file mode 100644 index 00000000000..be6d28a7bbb --- /dev/null +++ b/spec/models/twitter_user_info_spec.rb @@ -0,0 +1,10 @@ +require 'spec_helper' + +describe TwitterUserInfo do + it "does not overflow" do + id = 22019458041 + info = TwitterUserInfo.create!(user_id: -1, screen_name: 'sam', twitter_user_id: id) + info.reload + info.twitter_user_id.should == id + end +end