diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 259979b8e..61d36cf43 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -906,7 +906,6 @@ class StudentWorkController < ApplicationController @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? #老师、教辅可以随时评分,学生只能在匿评作业的匿评阶段进行评分 render_403 and return unless @is_teacher || @homework.homework_detail_manual.comment_status == 2 - @score = student_work_score @work,User.current #@score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != "" #@score.score = params[:score] if params[:score] #if User.current.admin? @@ -918,16 +917,19 @@ class StudentWorkController < ApplicationController #@is_new = false @is_last_a = @work.student_works_scores.empty? @new_score = StudentWorksScore.new - if @score && params[:score] - @new_score.score = params[:score].to_i == -1 ? @score.score : params[:score] - elsif @score.nil? && params[:score] - @new_score.score = params[:score].to_i == -1 ? nil : params[:score] + if params[:score] == -1 + score = student_work_score @work,User.current + @new_score.score = @score.try(:score) + else + @new_score.score = params[:score] end + @new_score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != "" @new_score.user_id = User.current.id @new_score.student_work_id = @work.id if @is_teacher && !@new_score.score.nil? && @work.work_status == 0 - @work.update_attributes(:work_status => 1, :commit_time => Time.now) + @work.work_status = 1 + @work.commit_time = Time.now #更新CourseHomeworkStatistics中学生的已交作品数、未交作品数 course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, @work.user_id) course_statistics.update_attribute('committed_work_num', course_statistics.committed_work_num + 1) if course_statistics @@ -939,16 +941,6 @@ class StudentWorkController < ApplicationController role = User.current.members.where("course_id = ?",@course.id).first.roles.where("is_current = 1").first.name @new_score.reviewer_role = get_role_by_name(role) end - if @score - if @is_teacher - @is_new = true - @is_last_a = false - else - @is_new = false - end - else - @is_new = true - end @new_score.save_attachments(params[:attachments]) render_attachment_warning_if_needed(@new_score) @@ -994,7 +986,7 @@ class StudentWorkController < ApplicationController @homework.update_column('updated_at', Time.now) update_course_activity(@homework.class,@homework.id) update_user_activity(@homework.class,@homework.id) - update_org_activity(@homework.class,@homework.id) + # update_org_activity(@homework.class,@homework.id) if @work.save @work = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:id => @work.id).first @count = @homework.student_works.has_committed.count diff --git a/app/models/student_work.rb b/app/models/student_work.rb index ab7835921..566d980c4 100644 --- a/app/models/student_work.rb +++ b/app/models/student_work.rb @@ -206,11 +206,9 @@ class StudentWork < ActiveRecord::Base course_homework_statistics = CourseHomeworkStatistics.where(:user_id => self.user_id, :course_id => self.homework_common.course_id).first if course_homework_statistics course = self.homework_common.course - homework_ids = course.homework_commons.empty? ? "(-1)" : "(" + course.homework_commons.map{|hw| hw.id}.join(",") + ")" - student_works = StudentWork.where("homework_common_id in #{homework_ids} and work_status !=0") user = self.user - average_score = user.student_works.where(:id => student_works.map(&:id)).select("AVG(student_works.work_score) as score").first ? user.student_works.where(:id => student_works.map(&:id)).select("AVG(student_works.work_score) as score").first.score : 0 - total_score = user.student_works.where(:id => student_works.map(&:id)).select("SUM(student_works.work_score) as score").first ? user.student_works.where(:id => student_works.map(&:id)).select("SUM(student_works.work_score) as score").first.score : 0 + average_score = user.student_works.where(:homework_common_id => course.homework_commons.map(&:id)).select("AVG(student_works.work_score) as score").first ? user.student_works.where(:homework_common_id => course.homework_commons.map(&:id)).select("AVG(student_works.work_score) as score").first.score : 0 + total_score = user.student_works.where(:homework_common_id => course.homework_commons.map(&:id)).select("SUM(student_works.work_score) as score").first ? user.student_works.where(:homework_common_id => course.homework_commons.map(&:id)).select("SUM(student_works.work_score) as score").first.score : 0 course_homework_statistics.update_attributes(:average_score => average_score, :total_score => total_score) end end diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb index f7fad7088..d298670ec 100644 --- a/app/views/student_work/add_score.js.erb +++ b/app/views/student_work/add_score.js.erb @@ -1,4 +1,4 @@ -<% is_member_work = @homework.homework_type == 3 && @work.student_work_projects.empty? %> +<% is_member_work = @homework.homework_type == 3 && !@is_group_leader %> $("#add_student_score_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'add_score',:locals => {:work => @work,:score => @new_score,:is_member_work => is_member_work}) %>"); $('#score_<%= @work.id%>').peSlider({range: 'min'}); diff --git a/db/migrate/20180702025109_add_index_to_message_all.rb b/db/migrate/20180702025109_add_index_to_message_all.rb new file mode 100644 index 000000000..b9effb552 --- /dev/null +++ b/db/migrate/20180702025109_add_index_to_message_all.rb @@ -0,0 +1,7 @@ +class AddIndexToMessageAll < ActiveRecord::Migration + def change + remove_index :message_alls, name: 'index_message_alls_on_user_id_and_message_id_and_created_at' + remove_index :message_alls, :message_type + add_index :message_alls, [:message_id] + end +end diff --git a/db/schema.rb b/db/schema.rb index 6f24eed54..7b2907039 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 => 20180610133055) do +ActiveRecord::Schema.define(:version => 20180702025109) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -84,6 +84,33 @@ ActiveRecord::Schema.define(:version => 20180610133055) do t.integer "role", :default => 0 end + create_table "apply_actions", :force => true do |t| + t.integer "user_id" + t.string "reason" + t.integer "container_id" + t.string "container_type" + t.integer "dealer_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :limit => 1, :default => 0 + t.text "apply_reason" + end + + create_table "apply_add_departments", :force => true do |t| + t.string "name" + t.integer "department_id" + t.integer "school_id" + t.text "remarks" + t.integer "user_id" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "apply_add_departments", ["department_id"], :name => "index_apply_add_departments_on_department_id" + add_index "apply_add_departments", ["school_id"], :name => "index_apply_add_departments_on_school_id" + add_index "apply_add_departments", ["user_id"], :name => "index_apply_add_departments_on_user_id" + create_table "apply_add_schools", :force => true do |t| t.string "name" t.string "province" @@ -129,6 +156,20 @@ ActiveRecord::Schema.define(:version => 20180610133055) do t.integer "apply_user_id" end + create_table "apply_user_authentications", :force => true do |t| + t.integer "user_id" + t.integer "status" + t.integer "auth_type" + t.string "remarks" + t.integer "dealer" + t.datetime "deal_time" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "is_delete", :default => false + end + + add_index "apply_user_authentications", ["user_id"], :name => "index_apply_user_authentications_on_user_id" + create_table "article_homepages", :force => true do |t| t.string "title" t.text "content" @@ -228,6 +269,16 @@ ActiveRecord::Schema.define(:version => 20180610133055) do add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type" + create_table "authentications", :force => true do |t| + t.integer "level", :limit => 1 + t.text "permissions" + end + + create_table "authentications_users", :force => true do |t| + t.integer "user_id" + t.integer "authentication_id" + end + create_table "biding_projects", :force => true do |t| t.integer "project_id" t.integer "bid_id" @@ -329,6 +380,68 @@ ActiveRecord::Schema.define(:version => 20180610133055) do t.datetime "updated_at", :null => false end + create_table "challenge_chooses", :force => true do |t| + t.text "subject" + t.integer "challenge_id" + t.string "standard_answer" + t.text "answer" + t.integer "score" + t.integer "difficult" + t.integer "category" + t.integer "position", :default => 1 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "challenge_questions", :force => true do |t| + t.text "option_name" + t.integer "challenge_choose_id" + t.boolean "right_key" + t.integer "position", :limit => 1 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "challenge_samples", :force => true do |t| + t.string "input" + t.string "output" + t.integer "challenge_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "game_id" + end + + create_table "challenge_tags", :force => true do |t| + t.string "name" + t.integer "challenge_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "challenge_choose_id" + end + + create_table "challenges", :force => true do |t| + t.integer "shixun_id" + t.string "subject" + t.text "description" + t.integer "user_id" + t.integer "status", :limit => 1, :default => 0 + t.integer "position", :limit => 1, :default => 1 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "ready_knowledge", :limit => 2147483647 + t.text "task_pass", :limit => 2147483647 + t.text "answer", :limit => 2147483647 + t.integer "score", :default => 100 + t.integer "visits", :default => 0 + t.string "path" + t.integer "evaluation_way", :default => 0 + t.integer "difficulty", :default => 1 + t.text "pipeline_script" + t.string "exec_path" + t.integer "code_line" + t.integer "st", :limit => 1, :default => 0 + end + create_table "changes", :force => true do |t| t.integer "changeset_id", :null => false t.string "action", :limit => 1, :default => "", :null => false @@ -375,6 +488,15 @@ ActiveRecord::Schema.define(:version => 20180610133055) do add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true + create_table "choose_outputs", :force => true do |t| + t.integer "challenge_choose_id" + t.integer "user_id" + t.string "answer" + t.boolean "correct" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "code_review_assignments", :force => true do |t| t.integer "issue_id" t.integer "change_id" @@ -521,6 +643,13 @@ ActiveRecord::Schema.define(:version => 20180610133055) do add_index "contest_messages", ["contest_id"], :name => "index_contest_messages_on_contest_id" add_index "contest_messages", ["user_id"], :name => "index_contest_messages_on_user_id" + create_table "contest_notifications", :force => true do |t| + t.text "title" + t.text "content" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "contestant_for_contests", :force => true do |t| t.integer "student_id" t.integer "contest_id" @@ -588,6 +717,37 @@ ActiveRecord::Schema.define(:version => 20180610133055) do add_index "contestant_works", ["user_id"], :name => "index_contestant_works_on_user_id" add_index "contestant_works", ["work_id"], :name => "index_contestant_works_on_work_id" + create_table "contesting_projects", :force => true do |t| + t.integer "project_id" + t.string "contest_id" + t.integer "user_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + end + + create_table "contesting_softapplications", :force => true do |t| + t.integer "softapplication_id" + t.integer "contest_id" + t.integer "user_id" + t.string "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "reward" + end + + create_table "contestnotifications", :force => true do |t| + t.integer "contest_id" + t.string "title" + t.string "summary" + t.text "description" + t.integer "author_id" + t.integer "notificationcomments_count" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "contests", :force => true do |t| t.integer "user_id" t.string "name" @@ -679,6 +839,15 @@ ActiveRecord::Schema.define(:version => 20180610133055) do t.datetime "updated_at", :null => false end + create_table "course_lists", :force => true do |t| + t.string "name" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "user_id" + t.boolean "is_admin", :default => true + t.boolean "support_shixuns_search", :default => false + end + create_table "course_messages", :force => true do |t| t.integer "user_id" t.integer "course_id" @@ -696,6 +865,15 @@ ActiveRecord::Schema.define(:version => 20180610133055) do add_index "course_messages", ["course_message_type"], :name => "index_course_messages_on_course_message_type" add_index "course_messages", ["user_id", "course_id", "created_at"], :name => "index_course_messages_on_user_id_and_course_id_and_created_at" + create_table "course_modules", :force => true do |t| + t.integer "course_id" + t.string "module_type" + t.integer "position" + t.integer "hidden" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "course_statuses", :force => true do |t| t.integer "changesets_count" t.integer "watchers_count" @@ -835,6 +1013,21 @@ ActiveRecord::Schema.define(:version => 20180610133055) do t.datetime "updated_at" end + create_table "departments", :force => true do |t| + t.string "name" + t.integer "school_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.boolean "is_auth", :default => false + end + + add_index "departments", ["school_id"], :name => "index_departments_on_school_id" + + create_table "discipline_categories", :force => true do |t| + t.integer "major_level" + t.string "name" + end + create_table "discuss_demos", :force => true do |t| t.string "title" t.text "body" @@ -842,6 +1035,21 @@ ActiveRecord::Schema.define(:version => 20180610133055) do t.datetime "updated_at", :null => false end + create_table "discusses", :force => true do |t| + t.integer "user_id" + t.string "dis_type" + t.integer "dis_id" + t.text "content" + t.integer "parent_id" + t.integer "root_id" + t.integer "praise_count" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "challenge_id" + end + + add_index "discusses", ["user_id"], :name => "index_discusses_on_user_id" + create_table "documents", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.integer "category_id", :default => 0, :null => false @@ -906,6 +1114,15 @@ ActiveRecord::Schema.define(:version => 20180610133055) do add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type" add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id" + create_table "evaluate_records", :force => true do |t| + t.integer "user_id" + t.integer "shixun_id" + t.integer "game_id" + t.integer "consume_time" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "exercise_answers", :force => true do |t| t.integer "user_id" t.integer "exercise_question_id" @@ -919,6 +1136,54 @@ ActiveRecord::Schema.define(:version => 20180610133055) do add_index "exercise_answers", ["exercise_choice_id"], :name => "ec" add_index "exercise_answers", ["exercise_question_id", "user_id"], :name => "ea" + create_table "exercise_bank_choices", :force => true do |t| + t.integer "exercise_bank_question_id" + t.text "choice_text" + t.integer "choice_position" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "exercise_bank_choices", ["exercise_bank_question_id"], :name => "index_exercise_bank_choices_on_exercise_bank_question_id" + + create_table "exercise_bank_questions", :force => true do |t| + t.text "question_title" + t.integer "question_type" + t.integer "question_number" + t.integer "question_score" + t.integer "exercise_bank_id" + t.integer "max_choices" + t.integer "min_choices" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "exercise_bank_questions", ["exercise_bank_id"], :name => "index_exercise_bank_questions_on_exercise_bank_id" + + create_table "exercise_bank_standard_answers", :force => true do |t| + t.integer "exercise_bank_question_id" + t.integer "exercise_bank_choice_id" + t.text "answer_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "exercise_banks", :force => true do |t| + t.string "name" + t.text "description" + t.integer "user_id" + t.boolean "is_public" + t.integer "quotes" + t.integer "container_id" + t.string "container_type" + t.integer "course_list_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "exercise_banks", ["course_list_id"], :name => "index_exercise_banks_on_course_list_id" + add_index "exercise_banks", ["user_id"], :name => "index_exercise_banks_on_user_id" + create_table "exercise_choices", :force => true do |t| t.integer "exercise_question_id" t.text "choice_text" @@ -977,6 +1242,22 @@ ActiveRecord::Schema.define(:version => 20180610133055) do t.integer "choice_random", :default => 0 end + create_table "experiences", :force => true do |t| + t.integer "user_id" + t.integer "container_id" + t.string "container_type" + t.integer "score" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "first_level_disciplines", :force => true do |t| + t.integer "discipline_category_id" + t.string "name" + end + + add_index "first_level_disciplines", ["discipline_category_id"], :name => "index_first_level_disciplines_on_discipline_category_id" + create_table "first_pages", :force => true do |t| t.string "web_title" t.string "title" @@ -1041,6 +1322,50 @@ ActiveRecord::Schema.define(:version => 20180610133055) do t.datetime "created_at" end + create_table "game_codes", :force => true do |t| + t.integer "game_id" + t.text "original_code", :limit => 2147483647 + t.text "new_code", :limit => 2147483647 + t.string "path" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.text "current_code", :limit => 2147483647 + end + + create_table "game_outputs", :force => true do |t| + t.integer "code" + t.integer "game_id" + t.text "msg" + t.text "out_put" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "games", :force => true do |t| + t.integer "myshixun_id" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 0 + t.integer "final_score", :default => 0 + t.integer "challenge_id" + t.datetime "open_time" + t.string "identifier" + t.boolean "answer_open", :default => false + t.datetime "end_time" + t.integer "retry_status", :default => 0 + t.string "resubmit_identifier" + end + + create_table "grades", :force => true do |t| + t.integer "user_id" + t.integer "container_id" + t.string "container_type" + t.integer "score" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "groups_users", :id => false, :force => true do |t| t.integer "group_id", :null => false t.integer "user_id", :null => false @@ -1074,6 +1399,26 @@ ActiveRecord::Schema.define(:version => 20180610133055) do add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id" + create_table "homework_bank_samples", :force => true do |t| + t.text "input" + t.text "output" + t.integer "homework_bank_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homework_bank_samples", ["homework_bank_id"], :name => "index_homework_bank_samples_on_homework_bank_id" + + create_table "homework_bank_shixuns", :force => true do |t| + t.integer "homework_bank_id" + t.integer "shixun_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homework_bank_shixuns", ["homework_bank_id"], :name => "index_homework_bank_shixuns_on_homework_bank_id" + add_index "homework_bank_shixuns", ["shixun_id"], :name => "index_homework_bank_shixuns_on_shixun_id" + create_table "homework_bank_tests", :force => true do |t| t.text "input" t.text "output" @@ -1125,6 +1470,13 @@ ActiveRecord::Schema.define(:version => 20180610133055) do add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" + create_table "homework_commons_shixuns", :force => true do |t| + t.integer "shixun_id" + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "homework_detail_groups", :force => true do |t| t.integer "homework_common_id" t.integer "min_num" @@ -1178,6 +1530,15 @@ ActiveRecord::Schema.define(:version => 20180610133055) do add_index "homework_for_courses", ["bid_id"], :name => "index_homework_for_courses_on_bid_id" add_index "homework_for_courses", ["course_id"], :name => "index_homework_for_courses_on_course_id" + create_table "homework_reference_answers", :force => true do |t| + t.text "answer" + t.integer "homework_common_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "homework_reference_answers", ["homework_common_id"], :name => "index_homework_reference_answers_on_homework_common_id" + create_table "homework_samples", :force => true do |t| t.text "input" t.text "output" @@ -1205,6 +1566,16 @@ ActiveRecord::Schema.define(:version => 20180610133055) do t.datetime "updated_at", :null => false end + create_table "import_students", :force => true do |t| + t.string "name" + t.string "student_number" + t.integer "course_id" + t.integer "school_id" + t.integer "status", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "innodb_monitor", :id => false, :force => true do |t| t.integer "a" end @@ -1375,6 +1746,34 @@ ActiveRecord::Schema.define(:version => 20180610133055) do t.datetime "updated_at", :null => false end + create_table "major_courses", :force => true do |t| + t.integer "course_list_id" + t.integer "major_id" + end + + add_index "major_courses", ["course_list_id"], :name => "index_major_courses_on_course_list_id" + add_index "major_courses", ["major_id"], :name => "index_major_courses_on_major_id" + + create_table "majors", :force => true do |t| + t.string "major_code" + t.string "name" + t.integer "first_level_discipline_id" + t.integer "discipline_category_id" + t.integer "major_level" + t.datetime "created_at" + t.datetime "updated_at" + t.boolean "support_shixuns", :default => false + end + + add_index "majors", ["discipline_category_id"], :name => "index_majors_on_discipline_category_id" + add_index "majors", ["first_level_discipline_id"], :name => "index_majors_on_first_level_discipline_id" + + create_table "mark_downs", :force => true do |t| + t.text "description" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "member_roles", :force => true do |t| t.integer "member_id", :null => false t.integer "role_id", :null => false @@ -1431,6 +1830,23 @@ ActiveRecord::Schema.define(:version => 20180610133055) do add_index "memos", ["root_id"], :name => "index_memos_on_root_id" + create_table "mess", :id => false, :force => true do |t| + t.string "课程名" + t.integer "课程ID", :default => 0, :null => false + t.string "教师姓", :default => "", :null => false + t.string "教师名", :limit => 30, :default => "", :null => false + t.string "主贴名", :default => "", :null => false + t.integer "主贴或回帖ID", :default => 0, :null => false + t.integer "回帖对应主贴ID" + t.integer "帖子点赞数" + t.integer "主贴回复数", :default => 0, :null => false + t.text "主贴或回帖内容" + t.datetime "发帖时间", :null => false + t.integer "发帖或回帖用户ID", :default => 0, :null => false + t.string "发帖或回帖用户姓", :default => "", :null => false + t.string "发帖或回帖用户名", :limit => 30, :default => "", :null => false + end + create_table "message_alls", :force => true do |t| t.integer "user_id" t.integer "message_id" @@ -1439,8 +1855,7 @@ ActiveRecord::Schema.define(:version => 20180610133055) do t.datetime "updated_at", :null => false end - add_index "message_alls", ["message_type"], :name => "index_message_alls_on_message_type" - add_index "message_alls", ["user_id", "message_id", "created_at"], :name => "index_message_alls_on_user_id_and_message_id_and_created_at" + add_index "message_alls", ["message_id"], :name => "index_message_alls_on_message_id" create_table "messages", :force => true do |t| t.integer "board_id", :null => false @@ -1467,6 +1882,81 @@ ActiveRecord::Schema.define(:version => 20180610133055) do add_index "messages", ["parent_id"], :name => "messages_parent_id" add_index "messages", ["root_id"], :name => "index_messages_on_root_id" + create_table "mirror_repositories", :force => true do |t| + t.string "mirrorID" + t.string "name" + t.string "main_type" + t.string "tag" + t.text "description" + t.integer "status" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "mirror_repository_types", :force => true do |t| + t.integer "mirror_type_id" + t.integer "mirror_repository_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "mirror_repository_types", ["mirror_repository_id"], :name => "index_mirror_repository_types_on_mirror_repository_id" + add_index "mirror_repository_types", ["mirror_type_id"], :name => "index_mirror_repository_types_on_mirror_type_id" + + create_table "mirror_types", :force => true do |t| + t.string "name" + t.integer "user_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "mirror_update_records", :force => true do |t| + t.integer "user_id" + t.integer "mirror_repository_id" + t.string "oldName" + t.string "newName" + t.string "oldType" + t.string "newType" + t.text "oldTag" + t.text "newTag" + t.text "oldDescription" + t.text "newDescription" + t.integer "oldStatus" + t.integer "newStatus" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "mirror_update_records", ["mirror_repository_id"], :name => "index_mirror_update_records_on_mirror_repository_id" + add_index "mirror_update_records", ["user_id"], :name => "index_mirror_update_records_on_user_id" + + create_table "myshixun_members", :force => true do |t| + t.integer "myshixun_id" + t.integer "user_id" + t.integer "role" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "myshixuns", :force => true do |t| + t.string "name" + t.text "description" + t.integer "shixun_id" + t.boolean "is_public", :default => true + t.integer "user_id" + t.integer "gpid" + t.integer "visits", :default => 0 + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "status", :default => 0 + t.string "identifier" + t.string "commit_id" + t.datetime "modify_time" + t.datetime "reset_time" + end + + add_index "myshixuns", ["user_id", "shixun_id"], :name => "index_myshixuns_on_user_id_and_shixun_id", :unique => true + create_table "news", :force => true do |t| t.integer "project_id" t.string "title", :limit => 60, :default => "", :null => false @@ -1662,1053 +2152,3 @@ ActiveRecord::Schema.define(:version => 20180610133055) do t.integer "allow_teacher", :default => 0 end - create_table "phone_app_versions", :force => true do |t| - t.string "version" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "poll_answers", :force => true do |t| - t.integer "poll_question_id" - t.text "answer_text" - t.integer "answer_position" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "poll_questions", :force => true do |t| - t.string "question_title" - t.integer "question_type" - t.integer "is_necessary" - t.integer "poll_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "question_number" - t.integer "max_choices", :default => 0 - t.integer "min_choices", :default => 0 - end - - create_table "poll_users", :force => true do |t| - t.integer "user_id" - t.integer "poll_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "poll_votes", :force => true do |t| - t.integer "user_id" - t.integer "poll_question_id" - t.integer "poll_answer_id" - t.text "vote_text" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "polls", :force => true do |t| - t.string "polls_name" - t.string "polls_type" - t.integer "polls_group_id" - t.integer "polls_status" - t.integer "user_id" - t.datetime "published_at" - t.datetime "closed_at" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "polls_description" - t.integer "show_result", :default => 1 - end - - create_table "praise_tread_caches", :force => true do |t| - t.integer "object_id", :null => false - t.string "object_type" - t.integer "praise_num" - t.integer "tread_num" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "praise_treads", :force => true do |t| - t.integer "user_id", :null => false - t.integer "praise_tread_object_id" - t.string "praise_tread_object_type" - t.integer "praise_or_tread" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "principal_activities", :force => true do |t| - t.integer "user_id" - t.integer "principal_id" - t.integer "principal_act_id" - t.string "principal_act_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "professional_levels", :force => true do |t| - t.string "level" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "project_infos", :force => true do |t| - t.integer "project_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "project_scores", :force => true do |t| - t.string "project_id" - t.integer "score" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "issue_num", :default => 0 - t.integer "issue_journal_num", :default => 0 - t.integer "news_num", :default => 0 - t.integer "documents_num", :default => 0 - t.integer "changeset_num", :default => 0 - t.integer "board_message_num", :default => 0 - t.integer "board_num", :default => 0 - t.integer "attach_num", :default => 0 - t.datetime "commit_time" - t.integer "pull_request_num", :default => 0 - end - - create_table "project_statuses", :force => true do |t| - t.integer "changesets_count" - t.integer "watchers_count" - t.integer "project_id" - t.integer "project_type" - t.float "grade", :default => 0.0 - t.integer "course_ac_para", :default => 0 - end - - add_index "project_statuses", ["grade"], :name => "index_project_statuses_on_grade" - - create_table "projecting_softapplictions", :force => true do |t| - t.integer "user_id" - t.integer "softapplication_id" - t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "projects", :force => true do |t| - t.string "name", :default => "", :null => false - t.text "description" - t.string "homepage", :default => "" - t.boolean "is_public", :default => true, :null => false - t.integer "parent_id" - t.datetime "created_on" - t.datetime "updated_on" - t.string "identifier" - t.integer "status", :default => 1, :null => false - t.integer "lft" - t.integer "rgt" - t.boolean "inherit_members", :default => false, :null => false - t.integer "project_type" - t.boolean "hidden_repo", :default => false, :null => false - t.integer "attachmenttype", :default => 1 - t.integer "user_id" - t.integer "dts_test", :default => 0 - t.string "enterprise_name" - t.integer "organization_id" - t.integer "project_new_type" - t.integer "gpid" - t.integer "forked_from_project_id" - t.integer "forked_count" - t.integer "publish_resource", :default => 0 - t.integer "visits", :default => 0 - t.integer "hot", :default => 0 - t.string "invite_code" - t.string "qrcode" - t.integer "qrcode_expiretime", :default => 0 - t.text "script" - t.integer "training_status", :limit => 1, :default => 0 - t.string "language" - end - - add_index "projects", ["lft"], :name => "index_projects_on_lft" - add_index "projects", ["rgt"], :name => "index_projects_on_rgt" - - create_table "projects_trackers", :id => false, :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.integer "tracker_id", :default => 0, :null => false - end - - add_index "projects_trackers", ["project_id", "tracker_id"], :name => "projects_trackers_unique", :unique => true - add_index "projects_trackers", ["project_id"], :name => "projects_trackers_project_id" - - create_table "pull_requests", :force => true do |t| - t.integer "pull_request_id" - t.integer "gpid" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 0 - t.integer "project_id" - t.string "title" - t.text "jenkins_output", :limit => 2147483647 - end - - create_table "quality_analyses", :force => true do |t| - t.integer "project_id" - t.string "author_login" - t.string "rep_identifier" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "sonar_version", :default => 0 - t.string "path" - t.string "branch" - t.string "language" - t.string "sonar_name" - t.integer "pull_request_id" - end - - create_table "queries", :force => true do |t| - t.integer "project_id" - t.string "name", :default => "", :null => false - t.text "filters" - t.integer "user_id", :default => 0, :null => false - t.boolean "is_public", :default => false, :null => false - t.text "column_names" - t.text "sort_criteria" - t.string "group_by" - t.string "type" - end - - add_index "queries", ["project_id"], :name => "index_queries_on_project_id" - add_index "queries", ["user_id"], :name => "index_queries_on_user_id" - - create_table "relative_memo_to_open_source_projects", :force => true do |t| - t.integer "osp_id" - t.integer "relative_memo_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "relative_memos", :force => true do |t| - t.integer "osp_id" - t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :limit => 16777215, :null => false - t.integer "author_id" - t.integer "replies_count", :default => 0 - t.integer "last_reply_id" - t.boolean "lock", :default => false - t.boolean "sticky", :default => false - t.boolean "is_quote", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "viewed_count_crawl", :default => 0 - t.integer "viewed_count_local", :default => 0 - t.string "url" - t.string "username" - t.string "userhomeurl" - t.date "date_collected" - t.string "topic_resource" - end - - create_table "rep_statics", :force => true do |t| - t.integer "project_id" - t.integer "commits_num" - t.string "uname" - t.string "email" - t.integer "add" - t.integer "del" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "changeset" - end - - create_table "repositories", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.string "url", :default => "", :null => false - t.string "login", :limit => 60, :default => "" - t.string "password", :default => "" - t.string "root_url", :default => "" - t.string "type" - t.string "path_encoding", :limit => 64 - t.string "log_encoding", :limit => 64 - t.text "extra_info" - t.string "identifier" - t.boolean "is_default", :default => false - t.boolean "hidden", :default => false - end - - add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id" - - create_table "rich_rich_files", :force => true do |t| - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "rich_file_file_name" - t.string "rich_file_content_type" - t.integer "rich_file_file_size" - t.datetime "rich_file_updated_at" - t.string "owner_type" - t.integer "owner_id" - t.text "uri_cache" - t.string "simplified_type", :default => "file" - end - - create_table "roles", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.integer "position", :default => 1 - t.boolean "assignable", :default => true - t.integer "builtin", :default => 0, :null => false - t.text "permissions" - t.string "issues_visibility", :limit => 30, :default => "default", :null => false - end - - create_table "schools", :force => true do |t| - t.string "name" - t.string "province" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "logo_link" - t.string "pinyin" - t.integer "school_type", :default => 0 - end - - create_table "secdomains", :force => true do |t| - t.integer "sub_type" - t.string "subname" - t.integer "pid", :default => 0 - t.string "desc" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "seems_rateable_cached_ratings", :force => true do |t| - t.integer "cacheable_id", :limit => 8 - t.string "cacheable_type" - t.float "avg", :null => false - t.integer "cnt", :null => false - t.string "dimension" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "seems_rateable_rates", :force => true do |t| - t.integer "rater_id", :limit => 8 - t.integer "rateable_id" - t.string "rateable_type" - t.float "stars", :null => false - t.string "dimension" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "is_teacher_score", :default => 0 - end - - create_table "settings", :force => true do |t| - t.string "name", :default => "", :null => false - t.text "value" - t.datetime "updated_on" - end - - add_index "settings", ["name"], :name => "index_settings_on_name" - - create_table "shares", :force => true do |t| - t.date "created_on" - t.string "url" - t.string "title" - t.integer "share_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "project_id" - t.integer "user_id" - t.string "description" - end - - create_table "shield_activities", :force => true do |t| - t.string "container_type" - t.integer "container_id" - t.string "shield_type" - t.integer "shield_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "shield_wechat_messages", :force => true do |t| - t.integer "container_id" - t.string "container_type" - t.integer "shield_id" - t.string "shield_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "softapplications", :force => true do |t| - t.string "name" - t.text "description" - t.integer "app_type_id" - t.string "app_type_name" - t.string "android_min_version_available" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "contest_id" - t.integer "softapplication_id" - t.integer "is_public" - t.string "application_developers" - t.string "deposit_project_url" - t.string "deposit_project" - t.integer "project_id" - end - - create_table "sonar_errors", :force => true do |t| - t.integer "project_id" - t.string "jenkins_job_name" - t.text "output" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "ssos", :force => true do |t| - t.integer "user_id" - t.string "openid" - t.string "name" - t.string "password" - t.string "email" - t.integer "sex" - t.string "school" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "ssos", ["user_id"], :name => "index_ssos_on_user_id" - - create_table "statistics", :force => true do |t| - t.string "name" - t.text "description" - t.integer "user_id" - t.integer "status", :limit => 1, :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "main_category_id" - t.integer "sub_category_id" - t.float "file_size" - end - - create_table "student_work_projects", :force => true do |t| - t.integer "homework_common_id" - t.integer "student_work_id" - t.integer "project_id" - t.integer "user_id" - t.integer "is_leader" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "course_id" - end - - add_index "student_work_projects", ["homework_common_id"], :name => "index_student_work_projects_on_homework_common_id" - add_index "student_work_projects", ["project_id"], :name => "index_student_work_projects_on_project_id" - add_index "student_work_projects", ["student_work_id"], :name => "index_student_work_projects_on_student_work_id" - add_index "student_work_projects", ["user_id"], :name => "index_student_work_projects_on_user_id" - - create_table "student_work_tests", :force => true do |t| - t.integer "student_work_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "status", :default => 9 - t.text "results" - t.text "src" - end - - add_index "student_work_tests", ["student_work_id"], :name => "index_student_work_tests_on_student_work_id" - - create_table "student_works", :force => true do |t| - t.string "name" - t.text "description", :limit => 2147483647 - t.integer "homework_common_id" - t.integer "user_id" - t.float "final_score" - t.float "teacher_score" - t.float "student_score" - t.float "teaching_asistant_score" - t.integer "project_id", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "late_penalty", :default => 0 - t.integer "absence_penalty", :default => 0 - t.float "system_score", :default => 0.0 - t.boolean "is_test", :default => false - t.integer "simi_id" - t.integer "simi_value" - t.float "work_score" - t.integer "work_status", :default => 0 - t.datetime "commit_time" - t.integer "is_delete", :default => 0 - t.integer "appeal_penalty", :default => 0 - t.boolean "re_commit", :default => false - end - - add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" - - create_table "student_works_evaluation_distributions", :force => true do |t| - t.integer "student_work_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "student_works_scores", :force => true do |t| - t.integer "student_work_id" - t.integer "user_id" - t.integer "score" - t.text "comment" - t.integer "reviewer_role" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "appeal_status", :default => 0 - t.boolean "is_hidden", :default => false - end - - add_index "student_works_scores", ["student_work_id"], :name => "student_work_id" - add_index "student_works_scores", ["user_id"], :name => "user_id" - - create_table "student_works_scores_appeals", :force => true do |t| - t.integer "student_works_score_id" - t.integer "user_id" - t.text "comment" - t.integer "appeal_status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "students_for_courses", :force => true do |t| - t.integer "student_id" - t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "students_for_courses", ["course_id"], :name => "index_students_for_courses_on_course_id" - add_index "students_for_courses", ["student_id"], :name => "index_students_for_courses_on_student_id" - - create_table "sub_categories", :force => true do |t| - t.string "name" - t.integer "main_category_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "sub_document_comments", :force => true do |t| - t.text "content" - t.text "title" - t.integer "sub_domain_id" - t.integer "creator_id" - t.integer "parent_id" - t.integer "reply_id" - t.integer "locked" - t.integer "sticky" - t.integer "org_subfield_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "sub_domains", :force => true do |t| - t.integer "org_subfield_id" - t.integer "priority", :default => 0 - t.string "name" - t.string "field_type" - t.integer "hide", :default => 0 - t.integer "status", :default => 0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "subfield_subdomain_dirs", :force => true do |t| - t.integer "org_subfield_id" - t.string "name" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "syllabus_members", :force => true do |t| - t.integer "rank" - t.integer "syllabus_id" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "syllabus_members", ["rank"], :name => "index_syllabus_members_on_rank" - add_index "syllabus_members", ["syllabus_id"], :name => "index_syllabus_members_on_syllabus_id" - add_index "syllabus_members", ["user_id"], :name => "index_syllabus_members_on_user_id" - - create_table "syllabuses", :force => true do |t| - t.string "title" - t.text "description" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "eng_name" - t.integer "syllabus_type" - t.integer "credit" - t.integer "hours" - t.integer "theory_hours" - t.integer "practice_hours" - t.string "applicable_major" - t.string "pre_course" - t.integer "visits", :default => 0 - t.integer "des_status", :default => 0 - end - - add_index "syllabuses", ["user_id"], :name => "index_syllabuses_on_user_id" - - create_table "system_messages", :force => true do |t| - t.integer "user_id" - t.string "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.text "description" - t.string "subject" - end - - create_table "taggings", :force => true do |t| - t.integer "tag_id" - t.integer "taggable_id" - t.string "taggable_type" - t.integer "tagger_id" - t.string "tagger_type" - t.string "context", :limit => 128 - t.datetime "created_at" - end - - add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id" - add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context" - add_index "taggings", ["taggable_type"], :name => "index_taggings_on_taggable_type" - - create_table "tags", :force => true do |t| - t.string "name" - end - - create_table "teachers", :force => true do |t| - t.string "tea_name" - t.string "location" - t.integer "couurse_time" - t.integer "course_code" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "extra" - end - - create_table "time_entries", :force => true do |t| - t.integer "project_id", :null => false - t.integer "user_id", :null => false - t.integer "issue_id" - t.float "hours", :null => false - t.string "comments" - t.integer "activity_id", :null => false - t.date "spent_on", :null => false - t.integer "tyear", :null => false - t.integer "tmonth", :null => false - t.integer "tweek", :null => false - t.datetime "created_on", :null => false - t.datetime "updated_on", :null => false - end - - add_index "time_entries", ["activity_id"], :name => "index_time_entries_on_activity_id" - add_index "time_entries", ["created_on"], :name => "index_time_entries_on_created_on" - add_index "time_entries", ["issue_id"], :name => "time_entries_issue_id" - add_index "time_entries", ["project_id"], :name => "time_entries_project_id" - add_index "time_entries", ["user_id"], :name => "index_time_entries_on_user_id" - - create_table "tokens", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.string "action", :limit => 30, :default => "", :null => false - t.string "value", :limit => 40, :default => "", :null => false - t.datetime "created_on", :null => false - end - - add_index "tokens", ["user_id"], :name => "index_tokens_on_user_id" - add_index "tokens", ["value"], :name => "tokens_value", :unique => true - - create_table "trackers", :force => true do |t| - t.string "name", :limit => 30, :default => "", :null => false - t.boolean "is_in_chlog", :default => false, :null => false - t.integer "position", :default => 1 - t.boolean "is_in_roadmap", :default => true, :null => false - t.integer "fields_bits", :default => 0 - end - - create_table "training_tasks", :force => true do |t| - t.integer "project_id" - t.integer "tracker_id" - t.string "subject" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "author_id" - t.integer "status", :limit => 1, :default => 0 - t.integer "position", :limit => 1, :default => 0 - t.integer "result", :default => 0 - end - - create_table "user_actions", :force => true do |t| - t.integer "user_id" - t.string "action_type" - t.integer "action_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_activities", :force => true do |t| - t.string "act_type" - t.integer "act_id" - t.string "container_type" - t.integer "container_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "user_id" - end - - add_index "user_activities", ["act_id", "act_type", "container_id", "created_at"], :name => "user_act_index" - - create_table "user_extensions", :force => true do |t| - t.integer "user_id", :null => false - t.date "birthday" - t.string "brief_introduction" - t.integer "gender" - t.string "location" - t.string "occupation" - t.integer "work_experience" - t.integer "zip_code" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "technical_title" - t.integer "identity" - t.string "student_id" - t.string "teacher_realname" - t.string "student_realname" - t.string "location_city" - t.integer "school_id" - t.string "description", :default => "" - end - - add_index "user_extensions", ["user_id"], :name => "index_user_extensions_on_user_id" - - create_table "user_feedback_messages", :force => true do |t| - t.integer "user_id" - t.integer "journals_for_message_id" - t.string "journals_for_message_type" - t.integer "viewed" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "user_feedback_messages", ["journals_for_message_id"], :name => "index_user_feedback_messages_on_journals_for_message_id" - add_index "user_feedback_messages", ["user_id", "created_at"], :name => "index_user_feedback_messages_on_user_id_and_created_at" - - create_table "user_grades", :force => true do |t| - t.integer "user_id", :null => false - t.integer "project_id", :null => false - t.float "grade", :default => 0.0 - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "user_grades", ["grade"], :name => "index_user_grades_on_grade" - add_index "user_grades", ["project_id"], :name => "index_user_grades_on_project_id" - add_index "user_grades", ["user_id"], :name => "index_user_grades_on_user_id" - - create_table "user_levels", :force => true do |t| - t.integer "user_id" - t.integer "level" - end - - create_table "user_preferences", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.text "others" - t.boolean "hide_mail", :default => false - t.string "time_zone" - end - - add_index "user_preferences", ["user_id"], :name => "index_user_preferences_on_user_id" - - create_table "user_score_details", :force => true do |t| - t.integer "current_user_id" - t.integer "target_user_id" - t.string "score_type" - t.string "score_action" - t.integer "user_id" - t.integer "old_score" - t.integer "new_score" - t.integer "current_user_level" - t.integer "target_user_level" - t.integer "score_changeable_obj_id" - t.string "score_changeable_obj_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_scores", :force => true do |t| - t.integer "user_id", :null => false - t.integer "collaboration" - t.integer "influence" - t.integer "skill" - t.integer "active" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "user_statuses", :force => true do |t| - t.integer "changesets_count" - t.integer "watchers_count" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.float "grade", :default => 0.0 - end - - add_index "user_statuses", ["changesets_count"], :name => "index_user_statuses_on_changesets_count" - add_index "user_statuses", ["grade"], :name => "index_user_statuses_on_grade" - add_index "user_statuses", ["watchers_count"], :name => "index_user_statuses_on_watchers_count" - - create_table "user_wechats", :force => true do |t| - t.integer "subscribe" - t.string "openid" - t.string "nickname" - t.integer "sex" - t.string "language" - t.string "city" - t.string "province" - t.string "country" - t.string "headimgurl" - t.string "subscribe_time" - t.string "unionid" - t.string "remark" - t.integer "groupid" - t.integer "user_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "bindtype", :default => 0 - end - - create_table "users", :force => true do |t| - t.string "login", :default => "", :null => false - t.string "hashed_password", :limit => 40, :default => "", :null => false - t.string "firstname", :limit => 30, :default => "", :null => false - t.string "lastname", :default => "", :null => false - t.string "mail", :limit => 60, :default => "", :null => false - t.boolean "admin", :default => false, :null => false - t.integer "status", :default => 1, :null => false - t.datetime "last_login_on" - t.string "language", :limit => 5, :default => "" - t.integer "auth_source_id" - t.datetime "created_on" - t.datetime "updated_on" - t.string "type" - t.string "identity_url" - t.string "mail_notification", :default => "", :null => false - t.string "salt", :limit => 64 - t.integer "gid" - t.integer "visits", :default => 0 - t.integer "excellent_teacher", :default => 0 - t.integer "excellent_student", :default => 0 - end - - add_index "users", ["auth_source_id"], :name => "index_users_on_auth_source_id" - add_index "users", ["id", "type"], :name => "index_users_on_id_and_type" - add_index "users", ["type"], :name => "index_users_on_type" - - create_table "versions", :force => true do |t| - t.integer "project_id", :default => 0, :null => false - t.string "name", :default => "", :null => false - t.string "description", :default => "" - t.date "effective_date" - t.datetime "created_on" - t.datetime "updated_on" - t.string "wiki_page_title" - t.string "status", :default => "open" - t.string "sharing", :default => "none", :null => false - t.integer "user_id" - end - - add_index "versions", ["project_id"], :name => "versions_project_id" - add_index "versions", ["sharing"], :name => "index_versions_on_sharing" - - create_table "visitors", :force => true do |t| - t.integer "user_id" - t.integer "master_id" - t.datetime "updated_on" - t.datetime "created_on" - end - - add_index "visitors", ["master_id"], :name => "index_visitors_master_id" - add_index "visitors", ["updated_on"], :name => "index_visitors_updated_on" - add_index "visitors", ["user_id"], :name => "index_visitors_user_id" - - create_table "watchers", :force => true do |t| - t.string "watchable_type", :default => "", :null => false - t.integer "watchable_id", :default => 0, :null => false - t.integer "user_id" - end - - add_index "watchers", ["user_id", "watchable_type"], :name => "watchers_user_id_type" - add_index "watchers", ["user_id"], :name => "index_watchers_on_user_id" - add_index "watchers", ["watchable_id", "watchable_type"], :name => "index_watchers_on_watchable_id_and_watchable_type" - - create_table "web_footer_companies", :force => true do |t| - t.string "name" - t.string "logo_size" - t.string "url" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "web_footer_oranizers", :force => true do |t| - t.string "name" - t.text "description" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "wechat_logs", :force => true do |t| - t.string "openid", :null => false - t.text "request_raw" - t.text "response_raw" - t.text "session_raw" - t.datetime "created_at", :null => false - end - - add_index "wechat_logs", ["openid"], :name => "index_wechat_logs_on_openid" - - create_table "wiki_content_versions", :force => true do |t| - t.integer "wiki_content_id", :null => false - t.integer "page_id", :null => false - t.integer "author_id" - t.binary "data", :limit => 2147483647 - t.string "compression", :limit => 6, :default => "" - t.string "comments", :default => "" - t.datetime "updated_on", :null => false - t.integer "version", :null => false - end - - add_index "wiki_content_versions", ["updated_on"], :name => "index_wiki_content_versions_on_updated_on" - add_index "wiki_content_versions", ["wiki_content_id"], :name => "wiki_content_versions_wcid" - - create_table "wiki_contents", :force => true do |t| - t.integer "page_id", :null => false - t.integer "author_id" - t.text "text", :limit => 2147483647 - t.string "comments", :default => "" - t.datetime "updated_on", :null => false - t.integer "version", :null => false - end - - add_index "wiki_contents", ["author_id"], :name => "index_wiki_contents_on_author_id" - add_index "wiki_contents", ["page_id"], :name => "wiki_contents_page_id" - - create_table "wiki_pages", :force => true do |t| - t.integer "wiki_id", :null => false - t.string "title", :null => false - t.datetime "created_on", :null => false - t.boolean "protected", :default => false, :null => false - t.integer "parent_id" - end - - add_index "wiki_pages", ["parent_id"], :name => "index_wiki_pages_on_parent_id" - add_index "wiki_pages", ["wiki_id", "title"], :name => "wiki_pages_wiki_id_title" - add_index "wiki_pages", ["wiki_id"], :name => "index_wiki_pages_on_wiki_id" - - create_table "wiki_redirects", :force => true do |t| - t.integer "wiki_id", :null => false - t.string "title" - t.string "redirects_to" - t.datetime "created_on", :null => false - end - - add_index "wiki_redirects", ["wiki_id", "title"], :name => "wiki_redirects_wiki_id_title" - add_index "wiki_redirects", ["wiki_id"], :name => "index_wiki_redirects_on_wiki_id" - - create_table "wikis", :force => true do |t| - t.integer "project_id", :null => false - t.string "start_page", :null => false - t.integer "status", :default => 1, :null => false - end - - add_index "wikis", ["project_id"], :name => "wikis_project_id" - - create_table "work_detail_groups", :force => true do |t| - t.integer "work_id" - t.integer "min_num" - t.integer "max_num" - t.boolean "base_on_project" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "work_detail_groups", ["work_id"], :name => "index_work_detail_groups_on_work_id" - - create_table "work_detail_manuals", :force => true do |t| - t.date "evaluation_start" - t.date "evaluation_end" - t.integer "evaluation_num" - t.integer "work_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - add_index "work_detail_manuals", ["work_id"], :name => "index_work_detail_manuals_on_work_id" - - create_table "workflows", :force => true do |t| - t.integer "tracker_id", :default => 0, :null => false - t.integer "old_status_id", :default => 0, :null => false - t.integer "new_status_id", :default => 0, :null => false - t.integer "role_id", :default => 0, :null => false - t.boolean "assignee", :default => false, :null => false - t.boolean "author", :default => false, :null => false - t.string "type", :limit => 30 - t.string "field_name", :limit => 30 - t.string "rule", :limit => 30 - end - - add_index "workflows", ["new_status_id"], :name => "index_workflows_on_new_status_id" - add_index "workflows", ["old_status_id"], :name => "index_workflows_on_old_status_id" - add_index "workflows", ["role_id", "tracker_id", "old_status_id"], :name => "wkfs_role_tracker_old_status" - add_index "workflows", ["role_id"], :name => "index_workflows_on_role_id" - - create_table "works", :force => true do |t| - t.string "name" - t.integer "user_id" - t.text "description" - t.date "publish_time" - t.date "end_time" - t.integer "work_type" - t.integer "contest_id" - t.boolean "is_delete", :default => false - t.boolean "score_open", :default => false - t.boolean "is_open", :default => false - t.integer "work_status" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.boolean "online_evaluation", :default => false - t.boolean "score_valid", :default => true - end - - add_index "works", ["contest_id"], :name => "index_works_on_contest_id" - add_index "works", ["user_id"], :name => "index_works_on_user_id" - - create_table "works_categories", :force => true do |t| - t.string "category" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - - create_table "zip_packs", :force => true do |t| - t.integer "user_id" - t.integer "homework_id" - t.string "file_digest" - t.string "file_path" - t.integer "pack_times", :default => 1 - t.integer "pack_size", :default => 0 - t.text "file_digests" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - -end