diff --git a/db/migrate/20160907061917_add_index_to_course_contributor_scores.rb b/db/migrate/20160907061917_add_index_to_course_contributor_scores.rb new file mode 100644 index 000000000..5deb98469 --- /dev/null +++ b/db/migrate/20160907061917_add_index_to_course_contributor_scores.rb @@ -0,0 +1,7 @@ +class AddIndexToCourseContributorScores < ActiveRecord::Migration + def change + add_index :course_contributor_scores, [:course_id, :user_id] + add_index :members, :course_id + add_index :course_groups, :course_id + end +end diff --git a/db/schema.rb b/db/schema.rb index 04111767e..d50361193 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160907055119) do +ActiveRecord::Schema.define(:version => 20160907061917) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -517,6 +517,8 @@ ActiveRecord::Schema.define(:version => 20160907055119) do t.integer "news_num", :default => 0 end + add_index "course_contributor_scores", ["course_id", "user_id"], :name => "index_course_contributor_scores_on_course_id_and_user_id" + create_table "course_groups", :force => true do |t| t.string "name" t.integer "course_id" @@ -524,6 +526,8 @@ ActiveRecord::Schema.define(:version => 20160907055119) do t.datetime "updated_at", :null => false end + add_index "course_groups", ["course_id"], :name => "index_course_groups_on_course_id" + create_table "course_infos", :force => true do |t| t.integer "course_id" t.integer "user_id" @@ -1140,6 +1144,7 @@ ActiveRecord::Schema.define(:version => 20160907055119) do t.integer "is_collect", :default => 1 end + add_index "members", ["course_id"], :name => "index_members_on_course_id" add_index "members", ["project_id"], :name => "index_members_on_project_id" add_index "members", ["user_id", "project_id", "course_id"], :name => "index_members_on_user_id_and_project_id", :unique => true add_index "members", ["user_id"], :name => "index_members_on_user_id"