diff options
author | Rhenium <rhenium@rhe.jp> | 2013-10-03 07:30:23 +0900 |
---|---|---|
committer | Rhenium <rhenium@rhe.jp> | 2013-10-03 07:30:23 +0900 |
commit | ceeb95cb0da8c70fc827d4390920fb7014d5e6d9 (patch) | |
tree | 91cee7e376a12612b1cff182a453e8bf5cef4198 /db | |
parent | 431be3dd571a8555c8dbc1308a85cf3fe2097773 (diff) | |
download | aclog-ceeb95cb0da8c70fc827d4390920fb7014d5e6d9.tar.gz |
add reactions_count to Tweet
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20131002191729_add_reactions_count_to_tweets.rb | 6 | ||||
-rw-r--r-- | db/schema.rb | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/db/migrate/20131002191729_add_reactions_count_to_tweets.rb b/db/migrate/20131002191729_add_reactions_count_to_tweets.rb new file mode 100644 index 0000000..1fe1792 --- /dev/null +++ b/db/migrate/20131002191729_add_reactions_count_to_tweets.rb @@ -0,0 +1,6 @@ +class AddReactionsCountToTweets < ActiveRecord::Migration + def change + add_column :tweets, :reactions_count, :integer, null: false, default: 0 + add_index :tweets, :reactions_count + end +end diff --git a/db/schema.rb b/db/schema.rb index 4c8e8aa..e798321 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20130805001722) do +ActiveRecord::Schema.define(version: 20131002191729) do create_table "accounts", force: true do |t| t.integer "user_id", limit: 8, null: false @@ -61,8 +61,10 @@ ActiveRecord::Schema.define(version: 20130805001722) do t.datetime "tweeted_at", null: false t.integer "favorites_count", default: 0, null: false t.integer "retweets_count", default: 0, null: false + t.integer "reactions_count", default: 0, null: false end + add_index "tweets", ["reactions_count"], name: "index_tweets_on_reactions_count", using: :btree add_index "tweets", ["user_id"], name: "index_tweets_on_user_id", using: :btree create_table "users", force: true do |t| |