aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
authorRhenium <rhenium@rhe.jp>2013-11-13 12:41:59 +0900
committerRhenium <rhenium@rhe.jp>2013-11-13 12:41:59 +0900
commit9e4d829b7c52e0e5c0807469a6380db7fa6d0d94 (patch)
treed4778505a7736e9105e8130b3bf19af935962b4b /db
parent320055c32bfd6eb67cc4b41444667f54eb0d0064 (diff)
downloadaclog-9e4d829b7c52e0e5c0807469a6380db7fa6d0d94.tar.gz
update indices of tweets table
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20131113033645_add_indices_to_tweets.rb6
-rw-r--r--db/schema.rb15
2 files changed, 19 insertions, 2 deletions
diff --git a/db/migrate/20131113033645_add_indices_to_tweets.rb b/db/migrate/20131113033645_add_indices_to_tweets.rb
new file mode 100644
index 0000000..0fb2919
--- /dev/null
+++ b/db/migrate/20131113033645_add_indices_to_tweets.rb
@@ -0,0 +1,6 @@
+class AddIndicesToTweets < ActiveRecord::Migration
+ def change
+ remove_index :tweets, :user_id
+ add_index :tweets, [:user_id, :reactions_count]
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 2cdedd7..ebbcfef 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: 20131002191729) do
+ActiveRecord::Schema.define(version: 20131113033645) do
create_table "accounts", force: true do |t|
t.integer "user_id", limit: 8, null: false
@@ -35,6 +35,17 @@ ActiveRecord::Schema.define(version: 20131002191729) do
add_index "favorites", ["tweet_id", "user_id"], name: "index_favorites_on_tweet_id_and_user_id", unique: true, using: :btree
add_index "favorites", ["user_id"], name: "index_favorites_on_user_id", using: :btree
+ create_table "issues", force: true do |t|
+ t.integer "issue_type", limit: 2
+ t.integer "status", limit: 2
+ t.text "data"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "issues", ["issue_type"], name: "index_issues_on_issue_type", using: :btree
+ add_index "issues", ["status"], name: "index_issues_on_status", using: :btree
+
create_table "retweets", force: true do |t|
t.integer "tweet_id", limit: 8, null: false
t.integer "user_id", limit: 8, null: false
@@ -54,7 +65,7 @@ ActiveRecord::Schema.define(version: 20131002191729) do
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
+ add_index "tweets", ["user_id", "reactions_count"], name: "index_tweets_on_user_id_and_reactions_count", using: :btree
create_table "users", force: true do |t|
t.string "screen_name", limit: 20