From b130b52a23ada16fd441f5c0d8384211540865a4 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 27 Nov 2015 16:55:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20151127011351_add_course_contributor_total_score.rb | 2 +- db/schema.rb | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/db/migrate/20151127011351_add_course_contributor_total_score.rb b/db/migrate/20151127011351_add_course_contributor_total_score.rb index 2606864d8..28ce55ef4 100644 --- a/db/migrate/20151127011351_add_course_contributor_total_score.rb +++ b/db/migrate/20151127011351_add_course_contributor_total_score.rb @@ -14,7 +14,7 @@ class AddCourseContributorTotalScore < ActiveRecord::Migration message_reply_count = Message.find_by_sql("select DISTINCT me.* from messages me, boards b where b.id = me.board_id and b.course_id = #{course.id} and b.project_id = '-1' and me.author_id = #{s.student_id} and me.parent_id is not null").count * 1 common_reply_count = Comment.find_by_sql("select cm.* from comments cm, news n where cm.author_id = #{s.student_id} and n.course_id = #{course.id} and cm.commented_id = n.id and cm.commented_type ='News'").count * 1 # attachment_count = CourseActivity.where("user_id =? and course_id =? and course_act_type =?", s.student_id, course.id, "Attachment").count * 5 - attachment_count = Attachment.find_by_sql("SELECT * FROM `attachments` where container_id = #{course.id} and author_id = #{s.student_id};").count * 5 + attachment_count = Attachment.find_by_sql("SELECT * FROM `attachments` where container_id = #{course.id} and author_id = #{s.student_id} and container_type ='Course'").count * 5 journal_count = JournalsForMessage.where("user_id =? and jour_id =? and jour_type =? ", s.student_id, course.id, "Course").count * 1 # journal_count = CourseActivity.where("user_id =? and course_id =? and course_act_type =?", s.student_id, course.id, "JournalsForMessage").count * 1 # journal_reply_count = JournalsForMessage.where("user_id =? and jour_id =? and jour_type =? and status =?", s.student_id, course.id, "Course",1).count * 1 diff --git a/db/schema.rb b/db/schema.rb index 603ca6857..87342bf9c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -605,7 +605,7 @@ ActiveRecord::Schema.define(:version => 20151127011351) do end create_table "exercise_questions", :force => true do |t| - t.string "question_title" + t.text "question_title" t.integer "question_type" t.integer "question_number" t.integer "exercise_id" @@ -634,7 +634,7 @@ ActiveRecord::Schema.define(:version => 20151127011351) do end create_table "exercises", :force => true do |t| - t.string "exercise_name" + t.text "exercise_name" t.text "exercise_description" t.integer "course_id" t.integer "exercise_status" @@ -1151,10 +1151,6 @@ ActiveRecord::Schema.define(:version => 20151127011351) do create_table "org_members", :force => true do |t| t.integer "user_id" t.integer "organization_id" -<<<<<<< HEAD - t.string "role" -======= ->>>>>>> 1ae514ca4857d7e2ad53b338731c1e01f899fb4d t.datetime "created_at", :null => false t.datetime "updated_at", :null => false end