2018-02-07 16:02:04 +08:00
|
|
|
# encoding: UTF-8
|
|
|
|
# This file is auto-generated from the current state of the database. Instead
|
|
|
|
# of editing this file, please use the migrations feature of Active Record to
|
|
|
|
# incrementally modify your database, and then regenerate this schema definition.
|
|
|
|
#
|
|
|
|
# Note that this schema.rb definition is the authoritative source for your
|
|
|
|
# database schema. If you need to create the application database on another
|
|
|
|
# system, you should be using db:schema:load, not running all the migrations
|
|
|
|
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
|
|
|
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
|
|
|
#
|
|
|
|
# It's strongly recommended to check this file into your version control system.
|
|
|
|
|
2018-05-04 17:17:07 +08:00
|
|
|
ActiveRecord::Schema.define(:version => 20180504075834) do
|
2018-02-07 16:02:04 +08:00
|
|
|
|
|
|
|
create_table "activities", :force => true do |t|
|
|
|
|
t.integer "act_id", :null => false
|
|
|
|
t.string "act_type", :null => false
|
|
|
|
t.integer "user_id", :null => false
|
|
|
|
t.integer "activity_container_id"
|
|
|
|
t.string "activity_container_type", :default => ""
|
|
|
|
t.datetime "created_at"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "activities", ["act_id", "act_type"], :name => "index_activities_on_act_id_and_act_type"
|
|
|
|
add_index "activities", ["user_id", "act_type"], :name => "index_activities_on_user_id_and_act_type"
|
|
|
|
add_index "activities", ["user_id"], :name => "index_activities_on_user_id"
|
|
|
|
|
|
|
|
create_table "activity_notifies", :force => true do |t|
|
|
|
|
t.integer "activity_container_id"
|
|
|
|
t.string "activity_container_type"
|
|
|
|
t.integer "activity_id"
|
|
|
|
t.string "activity_type"
|
|
|
|
t.integer "notify_to"
|
|
|
|
t.datetime "created_on"
|
|
|
|
t.integer "is_read"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "activity_notifies", ["activity_container_id", "activity_container_type"], :name => "index_an_activity_container_id"
|
|
|
|
add_index "activity_notifies", ["created_on"], :name => "index_an_created_on"
|
|
|
|
add_index "activity_notifies", ["notify_to"], :name => "index_an_notify_to"
|
|
|
|
|
|
|
|
create_table "api_keys", :force => true do |t|
|
|
|
|
t.string "access_token"
|
|
|
|
t.datetime "expires_at"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.boolean "active", :default => true
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "api_keys", ["access_token"], :name => "index_api_keys_on_access_token"
|
|
|
|
add_index "api_keys", ["user_id"], :name => "index_api_keys_on_user_id"
|
|
|
|
|
|
|
|
create_table "applied_contests", :force => true do |t|
|
|
|
|
t.integer "contest_id"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.string "role"
|
|
|
|
t.integer "status"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "applied_contests", ["contest_id"], :name => "index_applied_contests_on_contest_id"
|
|
|
|
add_index "applied_contests", ["user_id"], :name => "index_applied_contests_on_user_id"
|
|
|
|
|
|
|
|
create_table "applied_messages", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "applied_id"
|
|
|
|
t.string "applied_type"
|
|
|
|
t.integer "viewed", :default => 0
|
|
|
|
t.integer "status", :default => 0
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.string "name"
|
|
|
|
t.integer "applied_user_id"
|
|
|
|
t.integer "role"
|
|
|
|
t.integer "project_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "applied_projects", :force => true do |t|
|
|
|
|
t.integer "project_id", :null => false
|
|
|
|
t.integer "user_id", :null => false
|
|
|
|
t.integer "role", :default => 0
|
|
|
|
end
|
|
|
|
|
2018-02-09 15:38:18 +08:00
|
|
|
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"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
2018-02-09 15:38:18 +08:00
|
|
|
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"
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "apply_add_schools", :force => true do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.string "province"
|
|
|
|
t.string "city"
|
|
|
|
t.string "address"
|
|
|
|
t.string "remarks"
|
|
|
|
t.integer "school_id"
|
|
|
|
t.integer "status", :default => 0
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "user_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "apply_homeworks", :force => true do |t|
|
|
|
|
t.integer "status"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "homework_common_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "apply_homeworks", ["homework_common_id"], :name => "index_apply_homeworks_on_homework_common_id"
|
|
|
|
add_index "apply_homeworks", ["user_id"], :name => "index_apply_homeworks_on_user_id"
|
|
|
|
|
|
|
|
create_table "apply_project_masters", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.string "apply_type"
|
|
|
|
t.integer "apply_id"
|
|
|
|
t.integer "status"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "apply_resources", :force => true do |t|
|
|
|
|
t.integer "status"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "attachment_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "container_id"
|
|
|
|
t.string "container_type"
|
|
|
|
t.text "content"
|
|
|
|
t.integer "apply_user_id"
|
|
|
|
end
|
|
|
|
|
2018-02-09 15:38:18 +08:00
|
|
|
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"
|
2018-02-09 17:00:12 +08:00
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.boolean "is_delete", :default => false
|
2018-02-09 15:38:18 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
add_index "apply_user_authentications", ["user_id"], :name => "index_apply_user_authentications_on_user_id"
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "article_homepages", :force => true do |t|
|
|
|
|
t.string "title"
|
|
|
|
t.text "content"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "homepage_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "article_homepages", ["homepage_id"], :name => "index_article_homepages_on_homepage_id"
|
|
|
|
add_index "article_homepages", ["user_id"], :name => "index_article_homepages_on_user_id"
|
|
|
|
|
|
|
|
create_table "at_messages", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "at_message_id"
|
|
|
|
t.string "at_message_type"
|
|
|
|
t.boolean "viewed", :default => false
|
|
|
|
t.string "container_type"
|
|
|
|
t.integer "container_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "sender_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "at_messages", ["user_id"], :name => "index_at_messages_on_user_id"
|
|
|
|
|
|
|
|
create_table "attachment_histories", :force => true do |t|
|
|
|
|
t.integer "container_id"
|
|
|
|
t.string "container_type"
|
|
|
|
t.string "filename", :default => ""
|
|
|
|
t.string "disk_filename", :default => ""
|
|
|
|
t.integer "filesize", :default => 0
|
|
|
|
t.string "content_type", :default => ""
|
|
|
|
t.string "digest", :limit => 40, :default => ""
|
|
|
|
t.integer "downloads", :default => 0
|
|
|
|
t.integer "author_id"
|
|
|
|
t.datetime "created_on"
|
|
|
|
t.text "description"
|
|
|
|
t.string "disk_directory"
|
|
|
|
t.integer "attachtype"
|
|
|
|
t.integer "is_public"
|
|
|
|
t.integer "copy_from"
|
|
|
|
t.integer "quotes"
|
|
|
|
t.integer "version"
|
|
|
|
t.integer "attachment_id"
|
|
|
|
t.integer "is_publish", :default => 1
|
|
|
|
t.date "publish_time"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "attachments", :force => true do |t|
|
|
|
|
t.integer "container_id"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.string "container_type", :limit => 30
|
|
|
|
t.string "filename", :default => "", :null => false
|
|
|
|
t.string "disk_filename", :default => "", :null => false
|
|
|
|
t.integer "filesize", :default => 0, :null => false
|
|
|
|
t.string "content_type", :default => ""
|
|
|
|
t.string "digest", :limit => 40, :default => "", :null => false
|
|
|
|
t.integer "downloads", :default => 0, :null => false
|
|
|
|
t.integer "author_id", :default => 0, :null => false
|
2018-02-07 16:02:04 +08:00
|
|
|
t.datetime "created_on"
|
|
|
|
t.text "description"
|
|
|
|
t.string "disk_directory"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.integer "attachtype", :default => 1
|
|
|
|
t.integer "is_public", :default => 1
|
2018-02-07 16:02:04 +08:00
|
|
|
t.integer "copy_from"
|
|
|
|
t.integer "quotes"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.integer "is_publish", :default => 1
|
2018-02-07 16:02:04 +08:00
|
|
|
t.datetime "publish_time"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "attachments", ["author_id"], :name => "index_attachments_on_author_id"
|
|
|
|
add_index "attachments", ["container_id", "container_type"], :name => "index_attachments_on_container_id_and_container_type"
|
|
|
|
add_index "attachments", ["created_on"], :name => "index_attachments_on_created_on"
|
|
|
|
|
|
|
|
create_table "attachmentstypes", :force => true do |t|
|
|
|
|
t.integer "typeId", :null => false
|
|
|
|
t.string "typeName", :limit => 50
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "auth_sources", :force => true do |t|
|
|
|
|
t.string "type", :limit => 30, :default => "", :null => false
|
|
|
|
t.string "name", :limit => 60, :default => "", :null => false
|
|
|
|
t.string "host", :limit => 60
|
|
|
|
t.integer "port"
|
|
|
|
t.string "account"
|
|
|
|
t.string "account_password", :default => ""
|
|
|
|
t.string "base_dn"
|
|
|
|
t.string "attr_login", :limit => 30
|
|
|
|
t.string "attr_firstname", :limit => 30
|
|
|
|
t.string "attr_lastname", :limit => 30
|
|
|
|
t.string "attr_mail", :limit => 30
|
|
|
|
t.boolean "onthefly_register", :default => false, :null => false
|
|
|
|
t.boolean "tls", :default => false, :null => false
|
|
|
|
t.string "filter"
|
|
|
|
t.integer "timeout"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "auth_sources", ["id", "type"], :name => "index_auth_sources_on_id_and_type"
|
|
|
|
|
2018-02-09 15:38:18 +08:00
|
|
|
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
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "biding_projects", :force => true do |t|
|
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "bid_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 "bids", :force => true do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.string "budget", :null => false
|
|
|
|
t.integer "author_id"
|
|
|
|
t.date "deadline"
|
|
|
|
t.text "description"
|
|
|
|
t.datetime "created_on", :null => false
|
|
|
|
t.datetime "updated_on", :null => false
|
|
|
|
t.integer "commit"
|
|
|
|
t.integer "reward_type"
|
|
|
|
t.integer "homework_type"
|
|
|
|
t.integer "parent_id"
|
|
|
|
t.string "password"
|
|
|
|
t.integer "is_evaluation"
|
|
|
|
t.integer "proportion", :default => 60
|
|
|
|
t.integer "comment_status", :default => 0
|
|
|
|
t.integer "evaluation_num", :default => 3
|
|
|
|
t.integer "open_anonymous_evaluation", :default => 1
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "blog_comments", :force => true do |t|
|
|
|
|
t.integer "blog_id", :null => false
|
|
|
|
t.integer "parent_id"
|
|
|
|
t.string "title", :default => "", :null => false
|
|
|
|
t.text "content"
|
|
|
|
t.integer "author_id"
|
|
|
|
t.integer "comments_count", :default => 0, :null => false
|
|
|
|
t.integer "last_comment_id"
|
|
|
|
t.datetime "created_on", :null => false
|
|
|
|
t.datetime "updated_on", :null => false
|
|
|
|
t.boolean "locked", :default => false
|
|
|
|
t.integer "sticky", :default => 0
|
|
|
|
t.integer "reply_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "root_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "blog_comments", ["root_id"], :name => "index_blog_comments_on_root_id"
|
|
|
|
|
|
|
|
create_table "blog_messages", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "blog_message_id"
|
|
|
|
t.integer "blog_id"
|
|
|
|
t.string "blog_message_type"
|
|
|
|
t.boolean "viewed", :default => false
|
|
|
|
t.text "content"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "user_operator_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "blogs", :force => true do |t|
|
|
|
|
t.string "name", :default => "", :null => false
|
|
|
|
t.text "description"
|
|
|
|
t.integer "position", :default => 1
|
|
|
|
t.integer "article_count", :default => 0, :null => false
|
|
|
|
t.integer "comments_count", :default => 0, :null => false
|
|
|
|
t.integer "last_comments_id"
|
|
|
|
t.integer "parent_id"
|
|
|
|
t.integer "author_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "homepage_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "boards", :force => true do |t|
|
|
|
|
t.integer "project_id", :null => false
|
|
|
|
t.string "name", :default => "", :null => false
|
|
|
|
t.string "description"
|
|
|
|
t.integer "position", :default => 1
|
|
|
|
t.integer "topics_count", :default => 0, :null => false
|
|
|
|
t.integer "messages_count", :default => 0, :null => false
|
|
|
|
t.integer "last_message_id"
|
|
|
|
t.integer "parent_id"
|
|
|
|
t.integer "course_id"
|
|
|
|
t.integer "org_subfield_id"
|
|
|
|
t.integer "contest_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id"
|
|
|
|
add_index "boards", ["project_id"], :name => "boards_project_id"
|
|
|
|
|
|
|
|
create_table "bug_to_osps", :force => true do |t|
|
|
|
|
t.integer "osp_id"
|
|
|
|
t.integer "relative_memo_id"
|
|
|
|
t.string "description"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
2018-02-09 15:38:18 +08:00
|
|
|
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
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "changes", :force => true do |t|
|
|
|
|
t.integer "changeset_id", :null => false
|
|
|
|
t.string "action", :limit => 1, :default => "", :null => false
|
|
|
|
t.text "path", :null => false
|
|
|
|
t.text "from_path"
|
|
|
|
t.string "from_revision"
|
|
|
|
t.string "revision"
|
|
|
|
t.string "branch"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "changes", ["changeset_id"], :name => "changesets_changeset_id"
|
|
|
|
|
|
|
|
create_table "changeset_parents", :id => false, :force => true do |t|
|
|
|
|
t.integer "changeset_id", :null => false
|
|
|
|
t.integer "parent_id", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "changeset_parents", ["changeset_id"], :name => "changeset_parents_changeset_ids"
|
|
|
|
add_index "changeset_parents", ["parent_id"], :name => "changeset_parents_parent_ids"
|
|
|
|
|
|
|
|
create_table "changesets", :force => true do |t|
|
|
|
|
t.integer "repository_id", :null => false
|
|
|
|
t.string "revision", :null => false
|
|
|
|
t.string "committer"
|
|
|
|
t.datetime "committed_on", :null => false
|
|
|
|
t.text "comments"
|
|
|
|
t.date "commit_date"
|
|
|
|
t.string "scmid"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "type", :default => 0
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "changesets", ["committed_on"], :name => "index_changesets_on_committed_on"
|
|
|
|
add_index "changesets", ["repository_id", "revision"], :name => "changesets_repos_rev", :unique => true
|
|
|
|
add_index "changesets", ["repository_id", "scmid"], :name => "changesets_repos_scmid"
|
|
|
|
add_index "changesets", ["repository_id"], :name => "index_changesets_on_repository_id"
|
|
|
|
add_index "changesets", ["user_id"], :name => "index_changesets_on_user_id"
|
|
|
|
|
|
|
|
create_table "changesets_issues", :id => false, :force => true do |t|
|
|
|
|
t.integer "changeset_id", :null => false
|
|
|
|
t.integer "issue_id", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "changesets_issues", ["changeset_id", "issue_id"], :name => "changesets_issues_ids", :unique => true
|
|
|
|
|
2018-02-09 15:38:18 +08:00
|
|
|
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
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "code_review_assignments", :force => true do |t|
|
|
|
|
t.integer "issue_id"
|
|
|
|
t.integer "change_id"
|
|
|
|
t.integer "attachment_id"
|
|
|
|
t.string "file_path"
|
|
|
|
t.string "rev"
|
|
|
|
t.string "rev_to"
|
|
|
|
t.string "action_type"
|
|
|
|
t.integer "changeset_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "code_review_project_settings", :force => true do |t|
|
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "tracker_id"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
t.integer "updated_by"
|
|
|
|
t.boolean "hide_code_review_tab", :default => false
|
|
|
|
t.integer "auto_relation", :default => 1
|
|
|
|
t.integer "assignment_tracker_id"
|
|
|
|
t.text "auto_assign"
|
|
|
|
t.integer "lock_version", :default => 0, :null => false
|
|
|
|
t.boolean "tracker_in_review_dialog", :default => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "code_review_user_settings", :force => true do |t|
|
|
|
|
t.integer "user_id", :default => 0, :null => false
|
|
|
|
t.integer "mail_notification", :default => 0, :null => false
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "code_reviews", :force => true do |t|
|
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "change_id"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
t.integer "line"
|
|
|
|
t.integer "updated_by_id"
|
|
|
|
t.integer "lock_version", :default => 0, :null => false
|
|
|
|
t.integer "status_changed_from"
|
|
|
|
t.integer "status_changed_to"
|
|
|
|
t.integer "issue_id"
|
|
|
|
t.string "action_type"
|
|
|
|
t.string "file_path"
|
|
|
|
t.string "rev"
|
|
|
|
t.string "rev_to"
|
|
|
|
t.integer "attachment_id"
|
|
|
|
t.integer "file_count", :default => 0, :null => false
|
|
|
|
t.boolean "diff_all"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "code_tests", :force => true do |t|
|
|
|
|
t.integer "homework_id"
|
|
|
|
t.integer "wait_time", :default => 0
|
|
|
|
t.integer "language"
|
|
|
|
t.integer "status"
|
|
|
|
t.integer "time_used", :default => 0
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "student_work_id", :default => 0
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "comments", :force => true do |t|
|
|
|
|
t.string "commented_type", :limit => 30, :default => "", :null => false
|
|
|
|
t.integer "commented_id", :default => 0, :null => false
|
|
|
|
t.integer "author_id", :default => 0, :null => false
|
|
|
|
t.text "comments"
|
|
|
|
t.datetime "created_on", :null => false
|
|
|
|
t.datetime "updated_on", :null => false
|
|
|
|
t.integer "parent_id"
|
|
|
|
t.integer "comments_count", :default => 0
|
|
|
|
t.integer "reply_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "comments", ["author_id"], :name => "index_comments_on_author_id"
|
|
|
|
add_index "comments", ["commented_id", "commented_type"], :name => "index_comments_on_commented_id_and_commented_type"
|
|
|
|
|
|
|
|
create_table "commit_issues", :force => true do |t|
|
|
|
|
t.string "commit_id"
|
|
|
|
t.integer "issue_id"
|
|
|
|
t.integer "project_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "commits", :force => true do |t|
|
|
|
|
t.integer "repository_id"
|
|
|
|
t.string "version"
|
|
|
|
t.string "committer"
|
|
|
|
t.text "comments"
|
|
|
|
t.datetime "committed_on"
|
|
|
|
t.integer "project_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "contest_activities", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "contest_id"
|
|
|
|
t.integer "contest_act_id"
|
|
|
|
t.string "contest_act_type"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "contest_activities", ["contest_id"], :name => "index_contest_activities_on_contest_id"
|
|
|
|
add_index "contest_activities", ["user_id"], :name => "index_contest_activities_on_user_id"
|
|
|
|
|
|
|
|
create_table "contest_member_roles", :force => true do |t|
|
|
|
|
t.integer "contest_member_id"
|
|
|
|
t.integer "role_id"
|
|
|
|
t.boolean "is_current", :default => true
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "contest_member_roles", ["contest_member_id"], :name => "index_contest_member_roles_on_contest_member_id"
|
|
|
|
add_index "contest_member_roles", ["role_id"], :name => "index_contest_member_roles_on_role_id"
|
|
|
|
|
|
|
|
create_table "contest_members", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "contest_id"
|
|
|
|
t.boolean "is_collect", :default => true
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "contest_members", ["contest_id"], :name => "index_contest_members_on_contest_id"
|
|
|
|
add_index "contest_members", ["user_id"], :name => "index_contest_members_on_user_id"
|
|
|
|
|
|
|
|
create_table "contest_messages", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "contest_id"
|
|
|
|
t.integer "contest_message_id"
|
|
|
|
t.string "contest_message_type"
|
|
|
|
t.boolean "viewed", :default => false
|
|
|
|
t.text "content"
|
|
|
|
t.integer "status"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
2018-03-23 15:54:50 +08:00
|
|
|
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
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "contestant_for_contests", :force => true do |t|
|
|
|
|
t.integer "student_id"
|
|
|
|
t.integer "contest_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "contestant_for_contests", ["contest_id"], :name => "index_contestant_for_contests_on_contest_id"
|
|
|
|
add_index "contestant_for_contests", ["student_id"], :name => "index_contestant_for_contests_on_student_id"
|
|
|
|
|
|
|
|
create_table "contestant_work_evaluation_distributions", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "contestant_work_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "contestant_work_evaluation_distributions", ["user_id"], :name => "index_contestant_work_evaluation_distributions_on_user_id"
|
|
|
|
|
|
|
|
create_table "contestant_work_projects", :force => true do |t|
|
|
|
|
t.integer "contest_id"
|
|
|
|
t.integer "work_id"
|
|
|
|
t.integer "contestant_work_id"
|
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.boolean "is_leader"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "contestant_work_projects", ["contest_id"], :name => "index_contestant_work_projects_on_contest_id"
|
|
|
|
add_index "contestant_work_projects", ["contestant_work_id"], :name => "index_contestant_work_projects_on_contestant_work_id"
|
|
|
|
add_index "contestant_work_projects", ["user_id"], :name => "index_contestant_work_projects_on_user_id"
|
|
|
|
add_index "contestant_work_projects", ["work_id"], :name => "index_contestant_work_projects_on_work_id"
|
|
|
|
|
|
|
|
create_table "contestant_work_scores", :force => true do |t|
|
|
|
|
t.integer "contestant_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
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "contestant_work_scores", ["contestant_work_id"], :name => "index_contestant_work_scores_on_contestant_work_id"
|
|
|
|
add_index "contestant_work_scores", ["user_id"], :name => "index_contestant_work_scores_on_user_id"
|
|
|
|
|
|
|
|
create_table "contestant_works", :force => true do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.text "description"
|
|
|
|
t.integer "work_id"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.float "work_score"
|
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "work_status"
|
|
|
|
t.datetime "commit_time"
|
|
|
|
t.boolean "is_delete", :default => false
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "judge_score"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "contestant_works", ["project_id"], :name => "index_contestant_works_on_project_id"
|
|
|
|
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"
|
|
|
|
|
2018-03-23 15:54:50 +08:00
|
|
|
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
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "contests", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.string "name"
|
|
|
|
t.text "description"
|
|
|
|
t.boolean "is_public"
|
|
|
|
t.boolean "is_delete", :default => false
|
|
|
|
t.integer "visits", :default => 0
|
|
|
|
t.string "invite_code"
|
|
|
|
t.integer "invite_code_halt", :default => 0
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "course_activities", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "course_id"
|
|
|
|
t.integer "course_act_id"
|
|
|
|
t.string "course_act_type"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "course_activities", ["course_id", "course_act_id", "course_act_type", "created_at"], :name => "course_act_index"
|
|
|
|
|
|
|
|
create_table "course_attachments", :force => true do |t|
|
|
|
|
t.string "filename"
|
|
|
|
t.string "disk_filename"
|
|
|
|
t.integer "filesize"
|
|
|
|
t.string "content_type"
|
|
|
|
t.string "digest"
|
|
|
|
t.integer "downloads"
|
|
|
|
t.string "author_id"
|
|
|
|
t.string "integer"
|
|
|
|
t.string "description"
|
|
|
|
t.string "disk_directory"
|
|
|
|
t.integer "attachtype"
|
|
|
|
t.integer "is_public"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "container_id", :default => 0
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "course_contributor_scores", :force => true do |t|
|
|
|
|
t.integer "course_id"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "message_num", :default => 0
|
|
|
|
t.integer "message_reply_num", :default => 0
|
|
|
|
t.integer "news_reply_num", :default => 0
|
|
|
|
t.integer "resource_num", :default => 0
|
|
|
|
t.integer "journal_num", :default => 0
|
|
|
|
t.integer "journal_reply_num", :default => 0
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "total_score", :default => 0
|
|
|
|
t.integer "homework_journal_num", :default => 0
|
|
|
|
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"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "course_groups", ["course_id"], :name => "index_course_groups_on_course_id"
|
|
|
|
|
|
|
|
create_table "course_homework_statistics", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "course_id"
|
|
|
|
t.integer "committed_work_num", :default => 0
|
|
|
|
t.integer "un_commit_work_num", :default => 0
|
|
|
|
t.integer "late_commit_work_num", :default => 0
|
|
|
|
t.integer "absence_evaluation_work_num", :default => 0
|
|
|
|
t.integer "un_evaluation_work_num", :default => 0
|
|
|
|
t.integer "appeal_num", :default => 0
|
|
|
|
t.float "average_score", :default => 0.0
|
|
|
|
t.float "total_score", :default => 0.0
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "course_infos", :force => true do |t|
|
|
|
|
t.integer "course_id"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "course_lists", :force => true do |t|
|
2018-02-09 15:38:18 +08:00
|
|
|
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
|
2018-02-07 16:02:04 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
create_table "course_messages", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "course_id"
|
|
|
|
t.integer "course_message_id"
|
|
|
|
t.string "course_message_type"
|
|
|
|
t.integer "viewed"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.text "content"
|
|
|
|
t.integer "status"
|
|
|
|
t.integer "apply_user_id"
|
|
|
|
t.integer "apply_result"
|
|
|
|
end
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
2018-02-09 15:38:18 +08:00
|
|
|
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
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "course_statuses", :force => true do |t|
|
|
|
|
t.integer "changesets_count"
|
|
|
|
t.integer "watchers_count"
|
|
|
|
t.integer "course_id"
|
|
|
|
t.float "grade", :default => 0.0
|
|
|
|
t.integer "course_ac_para", :default => 0
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "courses", :force => true do |t|
|
|
|
|
t.integer "tea_id"
|
|
|
|
t.string "name"
|
|
|
|
t.integer "state"
|
|
|
|
t.string "code"
|
|
|
|
t.integer "time"
|
|
|
|
t.string "extra"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
2018-02-07 16:02:04 +08:00
|
|
|
t.string "location"
|
|
|
|
t.string "term"
|
|
|
|
t.string "string"
|
|
|
|
t.string "password"
|
|
|
|
t.string "setup_time"
|
|
|
|
t.string "endup_time"
|
|
|
|
t.string "class_period"
|
|
|
|
t.integer "school_id"
|
|
|
|
t.text "description"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.integer "status", :default => 1
|
|
|
|
t.integer "attachmenttype", :default => 2
|
2018-02-07 16:02:04 +08:00
|
|
|
t.integer "lft"
|
|
|
|
t.integer "rgt"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.integer "is_public", :limit => 1, :default => 1
|
|
|
|
t.integer "inherit_members", :limit => 1, :default => 1
|
|
|
|
t.integer "open_student", :default => 0
|
|
|
|
t.integer "outline", :default => 0
|
|
|
|
t.integer "publish_resource", :default => 0
|
|
|
|
t.integer "is_delete", :default => 0
|
2018-02-07 16:02:04 +08:00
|
|
|
t.integer "end_time"
|
|
|
|
t.string "end_term"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.integer "is_excellent", :default => 0
|
|
|
|
t.integer "excellent_option", :default => 0
|
|
|
|
t.integer "is_copy", :default => 0
|
|
|
|
t.integer "visits", :default => 0
|
2018-02-07 16:02:04 +08:00
|
|
|
t.integer "syllabus_id"
|
|
|
|
t.string "invite_code"
|
|
|
|
t.string "qrcode"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.integer "qrcode_expiretime", :default => 0
|
|
|
|
t.integer "invite_code_halt", :limit => 1, :default => 0
|
|
|
|
t.integer "os_allow", :default => 0
|
2018-02-07 16:02:04 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
add_index "courses", ["invite_code"], :name => "index_courses_on_invite_code", :unique => true
|
|
|
|
add_index "courses", ["syllabus_id"], :name => "index_courses_on_syllabus_id"
|
|
|
|
|
|
|
|
create_table "custom_fields", :force => true do |t|
|
|
|
|
t.string "type", :limit => 30, :default => "", :null => false
|
|
|
|
t.string "name", :limit => 30, :default => "", :null => false
|
|
|
|
t.string "field_format", :limit => 30, :default => "", :null => false
|
|
|
|
t.text "possible_values"
|
|
|
|
t.string "regexp", :default => ""
|
|
|
|
t.integer "min_length", :default => 0, :null => false
|
|
|
|
t.integer "max_length", :default => 0, :null => false
|
|
|
|
t.boolean "is_required", :default => false, :null => false
|
|
|
|
t.boolean "is_for_all", :default => false, :null => false
|
|
|
|
t.boolean "is_filter", :default => false, :null => false
|
|
|
|
t.integer "position", :default => 1
|
|
|
|
t.boolean "searchable", :default => false
|
|
|
|
t.text "default_value"
|
|
|
|
t.boolean "editable", :default => true
|
|
|
|
t.boolean "visible", :default => true, :null => false
|
|
|
|
t.boolean "multiple", :default => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "custom_fields", ["id", "type"], :name => "index_custom_fields_on_id_and_type"
|
|
|
|
|
|
|
|
create_table "custom_fields_projects", :id => false, :force => true do |t|
|
|
|
|
t.integer "custom_field_id", :default => 0, :null => false
|
|
|
|
t.integer "project_id", :default => 0, :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "custom_fields_projects", ["custom_field_id", "project_id"], :name => "index_custom_fields_projects_on_custom_field_id_and_project_id", :unique => true
|
|
|
|
|
|
|
|
create_table "custom_fields_trackers", :id => false, :force => true do |t|
|
|
|
|
t.integer "custom_field_id", :default => 0, :null => false
|
|
|
|
t.integer "tracker_id", :default => 0, :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "custom_fields_trackers", ["custom_field_id", "tracker_id"], :name => "index_custom_fields_trackers_on_custom_field_id_and_tracker_id", :unique => true
|
|
|
|
|
|
|
|
create_table "custom_values", :force => true do |t|
|
|
|
|
t.string "customized_type", :limit => 30, :default => "", :null => false
|
|
|
|
t.integer "customized_id", :default => 0, :null => false
|
|
|
|
t.integer "custom_field_id", :default => 0, :null => false
|
|
|
|
t.text "value"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "custom_values", ["custom_field_id"], :name => "index_custom_values_on_custom_field_id"
|
|
|
|
add_index "custom_values", ["customized_type", "customized_id"], :name => "custom_values_customized"
|
|
|
|
|
|
|
|
create_table "data_exceptions", :force => true do |t|
|
|
|
|
t.string "message"
|
|
|
|
t.integer "container_id"
|
|
|
|
t.string "container_type"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "delayed_jobs", :force => true do |t|
|
|
|
|
t.integer "priority", :default => 0, :null => false
|
|
|
|
t.integer "attempts", :default => 0, :null => false
|
|
|
|
t.text "handler", :null => false
|
|
|
|
t.text "last_error"
|
|
|
|
t.datetime "run_at"
|
|
|
|
t.datetime "locked_at"
|
|
|
|
t.datetime "failed_at"
|
|
|
|
t.string "locked_by"
|
|
|
|
t.string "queue"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
|
|
|
|
|
|
|
|
create_table "delayed_jobs_20161218", :id => false, :force => true do |t|
|
|
|
|
t.integer "id", :default => 0, :null => false
|
|
|
|
t.integer "priority", :default => 0, :null => false
|
|
|
|
t.integer "attempts", :default => 0, :null => false
|
|
|
|
t.text "handler", :null => false
|
|
|
|
t.text "last_error"
|
|
|
|
t.datetime "run_at"
|
|
|
|
t.datetime "locked_at"
|
|
|
|
t.datetime "failed_at"
|
|
|
|
t.string "locked_by"
|
|
|
|
t.string "queue"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
end
|
|
|
|
|
2018-02-09 15:38:18 +08:00
|
|
|
create_table "departments", :force => true do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.integer "school_id"
|
2018-02-09 17:00:12 +08:00
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.boolean "is_auth", :default => false
|
2018-02-09 15:38:18 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
add_index "departments", ["school_id"], :name => "index_departments_on_school_id"
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
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"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
2018-02-09 15:38:18 +08:00
|
|
|
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"
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "documents", :force => true do |t|
|
|
|
|
t.integer "project_id", :default => 0, :null => false
|
|
|
|
t.integer "category_id", :default => 0, :null => false
|
|
|
|
t.string "title", :limit => 60, :default => "", :null => false
|
|
|
|
t.text "description"
|
|
|
|
t.datetime "created_on"
|
|
|
|
t.integer "user_id", :default => 0
|
|
|
|
t.integer "is_public", :default => 1
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "documents", ["category_id"], :name => "index_documents_on_category_id"
|
|
|
|
add_index "documents", ["created_on"], :name => "index_documents_on_created_on"
|
|
|
|
add_index "documents", ["project_id"], :name => "documents_project_id"
|
|
|
|
|
|
|
|
create_table "dts", :primary_key => "Num", :force => true do |t|
|
|
|
|
t.string "Defect", :limit => 50
|
|
|
|
t.string "Category", :limit => 50
|
|
|
|
t.string "File"
|
|
|
|
t.string "Method"
|
|
|
|
t.string "Module", :limit => 20
|
|
|
|
t.string "Variable", :limit => 50
|
|
|
|
t.integer "StartLine"
|
|
|
|
t.integer "IPLine"
|
|
|
|
t.string "IPLineCode", :limit => 200
|
|
|
|
t.string "Judge", :limit => 15
|
|
|
|
t.integer "Review", :limit => 1
|
|
|
|
t.string "Description"
|
|
|
|
t.text "PreConditions", :limit => 2147483647
|
|
|
|
t.text "TraceInfo", :limit => 2147483647
|
|
|
|
t.text "Code", :limit => 2147483647
|
|
|
|
t.integer "project_id"
|
|
|
|
t.datetime "created_at"
|
|
|
|
t.datetime "updated_at"
|
|
|
|
t.integer "id", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "editor_of_documents", :force => true do |t|
|
|
|
|
t.integer "editor_id"
|
|
|
|
t.integer "org_document_comment_id"
|
|
|
|
t.datetime "created_at"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "enabled_modules", :force => true do |t|
|
|
|
|
t.integer "project_id"
|
|
|
|
t.string "name", :null => false
|
|
|
|
t.integer "course_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "enabled_modules", ["project_id"], :name => "enabled_modules_project_id"
|
|
|
|
|
|
|
|
create_table "enumerations", :force => true do |t|
|
|
|
|
t.string "name", :limit => 30, :default => "", :null => false
|
|
|
|
t.integer "position", :default => 1
|
|
|
|
t.boolean "is_default", :default => false, :null => false
|
|
|
|
t.string "type"
|
|
|
|
t.boolean "active", :default => true, :null => false
|
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "parent_id"
|
|
|
|
t.string "position_name", :limit => 30
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "enumerations", ["id", "type"], :name => "index_enumerations_on_id_and_type"
|
|
|
|
add_index "enumerations", ["project_id"], :name => "index_enumerations_on_project_id"
|
|
|
|
|
2018-02-09 17:00:12 +08:00
|
|
|
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
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "exercise_answers", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "exercise_question_id"
|
|
|
|
t.integer "exercise_choice_id"
|
|
|
|
t.text "answer_text"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "score", :default => -1
|
|
|
|
end
|
|
|
|
|
2018-05-04 17:17:07 +08:00
|
|
|
add_index "exercise_answers", ["exercise_choice_id"], :name => "ec"
|
|
|
|
add_index "exercise_answers", ["exercise_question_id", "user_id"], :name => "ea"
|
|
|
|
|
2018-02-09 17:00:12 +08:00
|
|
|
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"
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "exercise_choices", :force => true do |t|
|
|
|
|
t.integer "exercise_question_id"
|
|
|
|
t.text "choice_text"
|
|
|
|
t.integer "choice_position"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "exercise_questions", :force => true do |t|
|
|
|
|
t.text "question_title"
|
|
|
|
t.integer "question_type"
|
|
|
|
t.integer "question_number"
|
|
|
|
t.integer "exercise_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "question_score"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "exercise_standard_answers", :force => true do |t|
|
|
|
|
t.integer "exercise_question_id"
|
|
|
|
t.integer "exercise_choice_id"
|
|
|
|
t.text "answer_text"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "exercise_users", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "exercise_id"
|
|
|
|
t.integer "score"
|
|
|
|
t.datetime "start_at"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.datetime "end_at"
|
|
|
|
t.integer "status"
|
|
|
|
t.integer "commit_status", :default => 0
|
|
|
|
t.integer "objective_score", :default => -1
|
|
|
|
t.integer "subjective_score", :default => -1
|
|
|
|
end
|
|
|
|
|
2018-05-04 17:17:07 +08:00
|
|
|
add_index "exercise_users", ["exercise_id"], :name => "index_exercise_users_on_exercise_id"
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "exercises", :force => true do |t|
|
|
|
|
t.text "exercise_name"
|
|
|
|
t.text "exercise_description"
|
|
|
|
t.integer "course_id"
|
|
|
|
t.integer "exercise_status"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "time"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
2018-02-07 16:02:04 +08:00
|
|
|
t.datetime "publish_time"
|
|
|
|
t.datetime "end_time"
|
|
|
|
t.integer "show_result"
|
|
|
|
t.integer "question_random", :default => 0
|
|
|
|
t.integer "choice_random", :default => 0
|
2018-02-08 11:24:04 +08:00
|
|
|
end
|
|
|
|
|
2018-02-09 15:38:18 +08:00
|
|
|
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"
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "first_pages", :force => true do |t|
|
|
|
|
t.string "web_title"
|
|
|
|
t.string "title"
|
|
|
|
t.text "description"
|
|
|
|
t.string "page_type"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "sort_type"
|
|
|
|
t.integer "image_width", :default => 107
|
|
|
|
t.integer "image_height", :default => 63
|
|
|
|
t.integer "show_course", :default => 1
|
|
|
|
t.integer "show_contest", :default => 1
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "forge_activities", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "forge_act_id"
|
|
|
|
t.string "forge_act_type"
|
|
|
|
t.integer "org_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id"
|
|
|
|
add_index "forge_activities", ["project_id", "forge_act_id", "created_at", "forge_act_type"], :name => "forge_act_index"
|
|
|
|
|
|
|
|
create_table "forge_messages", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "forge_message_id"
|
|
|
|
t.string "forge_message_type"
|
|
|
|
t.integer "viewed"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.string "secret_key"
|
|
|
|
t.integer "status"
|
|
|
|
t.integer "operate_user_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "forge_messages", ["forge_message_id", "forge_message_type"], :name => "index_forge_messages_on_forge_message_id_and_forge_message_type"
|
|
|
|
add_index "forge_messages", ["user_id", "project_id", "created_at"], :name => "index_forge_messages_on_user_id_and_project_id_and_created_at"
|
|
|
|
|
|
|
|
create_table "forums", :force => true do |t|
|
|
|
|
t.string "name", :null => false
|
|
|
|
t.text "description"
|
|
|
|
t.integer "topic_count", :default => 0
|
|
|
|
t.integer "memo_count", :default => 0
|
|
|
|
t.integer "last_memo_id", :default => 0
|
|
|
|
t.integer "creator_id", :null => false
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "sticky"
|
|
|
|
t.integer "locked"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "forwards", :force => true do |t|
|
|
|
|
t.integer "from_id"
|
|
|
|
t.string "from_type"
|
|
|
|
t.integer "to_id"
|
|
|
|
t.string "to_type"
|
|
|
|
t.datetime "created_at"
|
|
|
|
end
|
|
|
|
|
2018-02-09 15:38:18 +08:00
|
|
|
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
|
2018-02-09 17:00:12 +08:00
|
|
|
t.text "current_code", :limit => 2147483647
|
2018-02-09 15:38:18 +08:00
|
|
|
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"
|
2018-02-09 17:00:12 +08:00
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
2018-02-09 15:38:18 +08:00
|
|
|
t.integer "status", :default => 0
|
|
|
|
t.integer "final_score", :default => 0
|
|
|
|
t.integer "challenge_id"
|
|
|
|
t.datetime "open_time"
|
|
|
|
t.string "identifier"
|
2018-02-09 17:00:12 +08:00
|
|
|
t.boolean "answer_open", :default => false
|
2018-02-09 15:38:18 +08:00
|
|
|
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
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "groups_users", :id => false, :force => true do |t|
|
|
|
|
t.integer "group_id", :null => false
|
|
|
|
t.integer "user_id", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "groups_users", ["group_id", "user_id"], :name => "groups_users_ids", :unique => true
|
|
|
|
|
|
|
|
create_table "homepages", :force => true do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.integer "article_id"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "homepages", ["user_id"], :name => "index_homepages_on_user_id"
|
|
|
|
|
|
|
|
create_table "homework_attaches", :force => true do |t|
|
|
|
|
t.integer "bid_id"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.string "reward"
|
|
|
|
t.string "name"
|
|
|
|
t.text "description"
|
|
|
|
t.integer "state"
|
|
|
|
t.integer "project_id", :default => 0
|
|
|
|
t.float "score", :default => 0.0
|
|
|
|
t.integer "is_teacher_score", :default => 0
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "homework_attaches", ["bid_id"], :name => "index_homework_attaches_on_bid_id"
|
|
|
|
|
2018-02-09 15:38:18 +08:00
|
|
|
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"
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "homework_bank_tests", :force => true do |t|
|
|
|
|
t.text "input"
|
|
|
|
t.text "output"
|
|
|
|
t.boolean "test_type"
|
|
|
|
t.integer "homework_bank_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "homework_banks", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.string "name"
|
|
|
|
t.text "description"
|
|
|
|
t.integer "homework_type"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.integer "quotes", :default => 0
|
2018-02-07 16:02:04 +08:00
|
|
|
t.boolean "is_public"
|
|
|
|
t.string "language"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.text "standard_code", :limit => 2147483647
|
2018-02-07 16:02:04 +08:00
|
|
|
t.integer "min_num"
|
|
|
|
t.integer "max_num"
|
|
|
|
t.boolean "base_on_project"
|
|
|
|
t.string "applicable_syllabus"
|
|
|
|
t.integer "homework_common_id"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
2018-02-07 16:02:04 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
create_table "homework_commons", :force => true do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.text "description"
|
|
|
|
t.datetime "publish_time"
|
|
|
|
t.datetime "end_time"
|
|
|
|
t.integer "homework_type", :default => 1
|
|
|
|
t.string "late_penalty"
|
|
|
|
t.integer "course_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "teacher_priority", :default => 1
|
|
|
|
t.integer "anonymous_comment", :default => 0
|
|
|
|
t.integer "quotes", :default => 0
|
|
|
|
t.integer "is_open", :default => 0
|
|
|
|
t.datetime "simi_time"
|
|
|
|
t.integer "score_open", :default => 1
|
|
|
|
t.integer "anonymous_appeal", :default => 0
|
|
|
|
t.integer "homework_bank_id"
|
|
|
|
t.boolean "is_update", :default => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id"
|
|
|
|
|
2018-02-09 15:38:18 +08:00
|
|
|
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
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "homework_detail_groups", :force => true do |t|
|
|
|
|
t.integer "homework_common_id"
|
|
|
|
t.integer "min_num"
|
|
|
|
t.integer "max_num"
|
|
|
|
t.integer "base_on_project"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "homework_detail_groups", ["homework_common_id"], :name => "index_homework_detail_groups_on_homework_common_id"
|
|
|
|
|
|
|
|
create_table "homework_detail_manuals", :force => true do |t|
|
|
|
|
t.float "ta_proportion"
|
|
|
|
t.integer "comment_status"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.date "evaluation_start"
|
|
|
|
t.date "evaluation_end"
|
2018-02-07 16:02:04 +08:00
|
|
|
t.integer "evaluation_num"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.integer "absence_penalty", :default => 1
|
2018-02-07 16:02:04 +08:00
|
|
|
t.integer "homework_common_id"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "no_anon_penalty", :default => 1
|
|
|
|
t.integer "appeal_penalty", :default => 0
|
|
|
|
t.integer "ta_mode", :default => 1
|
|
|
|
t.float "te_proportion", :default => 1.0
|
|
|
|
t.boolean "final_mode", :default => false
|
2018-02-07 16:02:04 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
create_table "homework_detail_programings", :force => true do |t|
|
|
|
|
t.string "language"
|
|
|
|
t.text "standard_code", :limit => 2147483647
|
|
|
|
t.integer "homework_common_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.float "ta_proportion", :default => 0.1
|
|
|
|
t.integer "question_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "homework_evaluations", :force => true do |t|
|
|
|
|
t.string "user_id"
|
|
|
|
t.string "homework_attach_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "homework_for_courses", :force => true do |t|
|
|
|
|
t.integer "course_id"
|
|
|
|
t.integer "bid_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
2018-02-09 15:38:18 +08:00
|
|
|
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"
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "homework_samples", :force => true do |t|
|
|
|
|
t.text "input"
|
|
|
|
t.text "output"
|
|
|
|
t.integer "homework_common_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "homework_samples", ["homework_common_id"], :name => "index_homework_samples_on_homework_common_id"
|
|
|
|
|
|
|
|
create_table "homework_tests", :force => true do |t|
|
|
|
|
t.text "input"
|
|
|
|
t.text "output"
|
|
|
|
t.integer "homework_common_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "result"
|
|
|
|
t.text "error_msg"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "homework_users", :force => true do |t|
|
|
|
|
t.string "homework_attach_id"
|
|
|
|
t.string "user_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
2018-02-09 15:38:18 +08:00
|
|
|
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
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "innodb_monitor", :id => false, :force => true do |t|
|
|
|
|
t.integer "a"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "invite_lists", :force => true do |t|
|
|
|
|
t.integer "project_id"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.string "mail"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "issue_categories", :force => true do |t|
|
|
|
|
t.integer "project_id", :default => 0, :null => false
|
|
|
|
t.string "name", :limit => 30, :default => "", :null => false
|
|
|
|
t.integer "assigned_to_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "issue_categories", ["assigned_to_id"], :name => "index_issue_categories_on_assigned_to_id"
|
|
|
|
add_index "issue_categories", ["project_id"], :name => "issue_categories_project_id"
|
|
|
|
|
|
|
|
create_table "issue_relations", :force => true do |t|
|
|
|
|
t.integer "issue_from_id", :null => false
|
|
|
|
t.integer "issue_to_id", :null => false
|
|
|
|
t.string "relation_type", :default => "", :null => false
|
|
|
|
t.integer "delay"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "issue_relations", ["issue_from_id", "issue_to_id"], :name => "index_issue_relations_on_issue_from_id_and_issue_to_id", :unique => true
|
|
|
|
add_index "issue_relations", ["issue_from_id"], :name => "index_issue_relations_on_issue_from_id"
|
|
|
|
add_index "issue_relations", ["issue_to_id"], :name => "index_issue_relations_on_issue_to_id"
|
|
|
|
|
|
|
|
create_table "issue_statuses", :force => true do |t|
|
|
|
|
t.string "name", :limit => 30, :default => "", :null => false
|
|
|
|
t.boolean "is_closed", :default => false, :null => false
|
|
|
|
t.boolean "is_default", :default => false, :null => false
|
|
|
|
t.integer "position", :default => 1
|
|
|
|
t.integer "default_done_ratio"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "issue_statuses", ["is_closed"], :name => "index_issue_statuses_on_is_closed"
|
|
|
|
add_index "issue_statuses", ["is_default"], :name => "index_issue_statuses_on_is_default"
|
|
|
|
add_index "issue_statuses", ["position"], :name => "index_issue_statuses_on_position"
|
|
|
|
|
|
|
|
create_table "issues", :force => true do |t|
|
|
|
|
t.integer "tracker_id", :null => false
|
|
|
|
t.integer "project_id", :null => false
|
|
|
|
t.string "subject", :default => "", :null => false
|
|
|
|
t.text "description"
|
|
|
|
t.date "due_date"
|
|
|
|
t.integer "category_id"
|
|
|
|
t.integer "status_id", :null => false
|
|
|
|
t.integer "assigned_to_id"
|
|
|
|
t.integer "priority_id", :null => false
|
|
|
|
t.integer "fixed_version_id"
|
|
|
|
t.integer "author_id", :null => false
|
|
|
|
t.integer "lock_version", :default => 0, :null => false
|
|
|
|
t.datetime "created_on"
|
|
|
|
t.datetime "updated_on"
|
|
|
|
t.date "start_date"
|
|
|
|
t.integer "done_ratio", :default => 0, :null => false
|
|
|
|
t.float "estimated_hours"
|
|
|
|
t.integer "parent_id"
|
|
|
|
t.integer "root_id"
|
|
|
|
t.integer "lft"
|
|
|
|
t.integer "rgt"
|
|
|
|
t.boolean "is_private", :default => false, :null => false
|
|
|
|
t.datetime "closed_on"
|
|
|
|
t.integer "project_issues_index"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "issues", ["assigned_to_id"], :name => "index_issues_on_assigned_to_id"
|
|
|
|
add_index "issues", ["author_id"], :name => "index_issues_on_author_id"
|
|
|
|
add_index "issues", ["category_id"], :name => "index_issues_on_category_id"
|
|
|
|
add_index "issues", ["created_on"], :name => "index_issues_on_created_on"
|
|
|
|
add_index "issues", ["fixed_version_id"], :name => "index_issues_on_fixed_version_id"
|
|
|
|
add_index "issues", ["priority_id"], :name => "index_issues_on_priority_id"
|
|
|
|
add_index "issues", ["project_id"], :name => "issues_project_id"
|
|
|
|
add_index "issues", ["root_id", "lft", "rgt"], :name => "index_issues_on_root_id_and_lft_and_rgt"
|
|
|
|
add_index "issues", ["status_id"], :name => "index_issues_on_status_id"
|
|
|
|
add_index "issues", ["tracker_id"], :name => "index_issues_on_tracker_id"
|
|
|
|
|
|
|
|
create_table "join_in_competitions", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "competition_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "join_in_contests", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "bid_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "journal_details", :force => true do |t|
|
|
|
|
t.integer "journal_id", :default => 0, :null => false
|
|
|
|
t.string "property", :limit => 30, :default => "", :null => false
|
|
|
|
t.string "prop_key", :limit => 30, :default => "", :null => false
|
|
|
|
t.text "old_value"
|
|
|
|
t.text "value"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id"
|
|
|
|
|
|
|
|
create_table "journal_replies", :id => false, :force => true do |t|
|
|
|
|
t.integer "journal_id"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "reply_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "journal_replies", ["journal_id"], :name => "index_journal_replies_on_journal_id"
|
|
|
|
add_index "journal_replies", ["reply_id"], :name => "index_journal_replies_on_reply_id"
|
|
|
|
add_index "journal_replies", ["user_id"], :name => "index_journal_replies_on_user_id"
|
|
|
|
|
|
|
|
create_table "journals", :force => true do |t|
|
|
|
|
t.integer "journalized_id", :default => 0, :null => false
|
|
|
|
t.string "journalized_type", :limit => 30, :default => "", :null => false
|
|
|
|
t.integer "user_id", :default => 0, :null => false
|
|
|
|
t.text "notes"
|
|
|
|
t.datetime "created_on", :null => false
|
|
|
|
t.boolean "private_notes", :default => false, :null => false
|
|
|
|
t.integer "parent_id"
|
|
|
|
t.integer "comments_count", :default => 0
|
|
|
|
t.integer "reply_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "journals", ["created_on"], :name => "index_journals_on_created_on"
|
|
|
|
add_index "journals", ["journalized_id", "journalized_type"], :name => "journals_journalized_id"
|
|
|
|
add_index "journals", ["journalized_id"], :name => "index_journals_on_journalized_id"
|
|
|
|
add_index "journals", ["user_id"], :name => "index_journals_on_user_id"
|
|
|
|
|
|
|
|
create_table "journals_for_messages", :force => true do |t|
|
|
|
|
t.integer "jour_id"
|
|
|
|
t.string "jour_type"
|
|
|
|
t.integer "user_id"
|
|
|
|
t.text "notes"
|
|
|
|
t.integer "status"
|
|
|
|
t.integer "reply_id"
|
|
|
|
t.datetime "created_on", :null => false
|
|
|
|
t.datetime "updated_on", :null => false
|
|
|
|
t.string "m_parent_id"
|
|
|
|
t.boolean "is_readed"
|
|
|
|
t.integer "m_reply_count"
|
|
|
|
t.integer "m_reply_id"
|
|
|
|
t.integer "is_comprehensive_evaluation"
|
|
|
|
t.integer "private", :default => 0
|
|
|
|
t.integer "root_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "journals_for_messages", ["root_id"], :name => "index_journals_for_messages_on_root_id"
|
|
|
|
|
|
|
|
create_table "kindeditor_assets", :force => true do |t|
|
|
|
|
t.string "asset"
|
|
|
|
t.integer "file_size"
|
|
|
|
t.string "file_type"
|
|
|
|
t.integer "owner_id"
|
|
|
|
t.string "asset_type"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "owner_type", :default => 0
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "main_categories", :force => true do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
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|
|
2018-02-09 15:38:18 +08:00
|
|
|
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
|
2018-02-07 16:02:04 +08:00
|
|
|
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"
|
|
|
|
|
2018-02-09 15:38:18 +08:00
|
|
|
create_table "mark_downs", :force => true do |t|
|
|
|
|
t.text "description"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "member_roles", :force => true do |t|
|
|
|
|
t.integer "member_id", :null => false
|
|
|
|
t.integer "role_id", :null => false
|
|
|
|
t.integer "inherited_from"
|
|
|
|
t.integer "is_current", :default => 1
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "member_roles", ["member_id"], :name => "index_member_roles_on_member_id"
|
|
|
|
add_index "member_roles", ["role_id"], :name => "index_member_roles_on_role_id"
|
|
|
|
|
|
|
|
create_table "members", :force => true do |t|
|
|
|
|
t.integer "user_id", :default => 0, :null => false
|
|
|
|
t.integer "project_id", :default => 0
|
|
|
|
t.datetime "created_on"
|
|
|
|
t.boolean "mail_notification", :default => false, :null => false
|
|
|
|
t.integer "course_id", :default => -1
|
|
|
|
t.integer "course_group_id", :default => 0
|
|
|
|
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"
|
|
|
|
|
|
|
|
create_table "memo_messages", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "forum_id"
|
|
|
|
t.integer "memo_id"
|
|
|
|
t.string "memo_type"
|
|
|
|
t.integer "viewed"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "memo_messages", ["memo_id", "memo_type"], :name => "index_memo_messages_on_memo_id_and_memo_type"
|
|
|
|
add_index "memo_messages", ["user_id", "forum_id", "created_at"], :name => "index_memo_messages_on_user_id_and_forum_id_and_created_at"
|
|
|
|
|
|
|
|
create_table "memos", :force => true do |t|
|
2018-03-23 15:54:50 +08:00
|
|
|
t.integer "forum_id", :null => false
|
2018-02-07 16:02:04 +08:00
|
|
|
t.integer "parent_id"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.string "subject", :null => false
|
|
|
|
t.text "content", :null => false
|
|
|
|
t.integer "author_id", :null => false
|
|
|
|
t.integer "replies_count", :default => 0
|
2018-02-07 16:02:04 +08:00
|
|
|
t.integer "last_reply_id"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.boolean "lock", :default => false
|
|
|
|
t.boolean "sticky", :default => false
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "viewed_count", :default => 0
|
2018-02-07 16:02:04 +08:00
|
|
|
t.integer "root_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "memos", ["root_id"], :name => "index_memos_on_root_id"
|
|
|
|
|
2018-03-23 15:54:50 +08:00
|
|
|
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
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "message_alls", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "message_id"
|
|
|
|
t.string "message_type"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
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"
|
|
|
|
|
|
|
|
create_table "messages", :force => true do |t|
|
2018-03-23 15:54:50 +08:00
|
|
|
t.integer "board_id", :null => false
|
2018-02-07 16:02:04 +08:00
|
|
|
t.integer "parent_id"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.string "subject", :default => "", :null => false
|
|
|
|
t.text "content"
|
2018-02-07 16:02:04 +08:00
|
|
|
t.integer "author_id"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.integer "replies_count", :default => 0, :null => false
|
2018-02-07 16:02:04 +08:00
|
|
|
t.integer "last_reply_id"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.datetime "created_on", :null => false
|
|
|
|
t.datetime "updated_on", :null => false
|
|
|
|
t.boolean "locked", :default => false
|
|
|
|
t.integer "sticky", :default => 0
|
2018-02-07 16:02:04 +08:00
|
|
|
t.integer "reply_id"
|
|
|
|
t.integer "quotes"
|
2018-03-23 15:54:50 +08:00
|
|
|
t.integer "status", :default => 0
|
2018-02-07 16:02:04 +08:00
|
|
|
t.integer "root_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "messages", ["author_id"], :name => "index_messages_on_author_id"
|
|
|
|
add_index "messages", ["board_id"], :name => "messages_board_id"
|
|
|
|
add_index "messages", ["created_on"], :name => "index_messages_on_created_on"
|
|
|
|
add_index "messages", ["last_reply_id"], :name => "index_messages_on_last_reply_id"
|
|
|
|
add_index "messages", ["parent_id"], :name => "messages_parent_id"
|
|
|
|
add_index "messages", ["root_id"], :name => "index_messages_on_root_id"
|
|
|
|
|
2018-02-09 15:38:18 +08:00
|
|
|
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
|
2018-03-23 15:54:50 +08:00
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
2018-02-09 15:38:18 +08:00
|
|
|
t.integer "status", :default => 0
|
|
|
|
t.string "identifier"
|
|
|
|
t.string "commit_id"
|
2018-02-09 17:00:12 +08:00
|
|
|
t.datetime "modify_time"
|
|
|
|
t.datetime "reset_time"
|
2018-02-09 15:38:18 +08:00
|
|
|
end
|
|
|
|
|
2018-02-09 17:00:12 +08:00
|
|
|
add_index "myshixuns", ["user_id", "shixun_id"], :name => "index_myshixuns_on_user_id_and_shixun_id", :unique => true
|
|
|
|
|
2018-02-07 16:02:04 +08:00
|
|
|
create_table "news", :force => true do |t|
|
|
|
|
t.integer "project_id"
|
|
|
|
t.string "title", :limit => 60, :default => "", :null => false
|
|
|
|
t.string "summary", :default => ""
|
|
|
|
t.text "description"
|
|
|
|
t.integer "author_id", :default => 0, :null => false
|
|
|
|
t.datetime "created_on"
|
|
|
|
t.integer "comments_count", :default => 0, :null => false
|
|
|
|
t.integer "course_id"
|
|
|
|
t.integer "sticky", :default => 0
|
|
|
|
t.integer "org_subfield_id"
|
|
|
|
t.integer "contest_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "news", ["author_id"], :name => "index_news_on_author_id"
|
|
|
|
add_index "news", ["created_on"], :name => "index_news_on_created_on"
|
|
|
|
add_index "news", ["project_id"], :name => "news_project_id"
|
|
|
|
|
|
|
|
create_table "no_uses", :force => true do |t|
|
|
|
|
t.integer "user_id", :null => false
|
|
|
|
t.string "no_use_type"
|
|
|
|
t.integer "no_use_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "notificationcomments", :force => true do |t|
|
|
|
|
t.string "notificationcommented_type"
|
|
|
|
t.integer "notificationcommented_id"
|
|
|
|
t.integer "author_id"
|
|
|
|
t.text "notificationcomments"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "onclick_times", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.datetime "onclick_time"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "open_id_authentication_associations", :force => true do |t|
|
|
|
|
t.integer "issued"
|
|
|
|
t.integer "lifetime"
|
|
|
|
t.string "handle"
|
|
|
|
t.string "assoc_type"
|
|
|
|
t.binary "server_url"
|
|
|
|
t.binary "secret"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "open_id_authentication_nonces", :force => true do |t|
|
|
|
|
t.integer "timestamp", :null => false
|
|
|
|
t.string "server_url"
|
|
|
|
t.string "salt", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "open_source_projects", :force => true do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.text "description"
|
|
|
|
t.integer "commit_count", :default => 0
|
|
|
|
t.integer "code_line", :default => 0
|
|
|
|
t.integer "users_count", :default => 0
|
|
|
|
t.date "last_commit_time"
|
|
|
|
t.string "url"
|
|
|
|
t.date "date_collected"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "option_numbers", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "memo"
|
|
|
|
t.integer "messages_for_issues"
|
|
|
|
t.integer "issues_status"
|
|
|
|
t.integer "replay_for_message"
|
|
|
|
t.integer "replay_for_memo"
|
|
|
|
t.integer "follow"
|
|
|
|
t.integer "tread"
|
|
|
|
t.integer "praise_by_one"
|
|
|
|
t.integer "praise_by_two"
|
|
|
|
t.integer "praise_by_three"
|
|
|
|
t.integer "tread_by_one"
|
|
|
|
t.integer "tread_by_two"
|
|
|
|
t.integer "tread_by_three"
|
|
|
|
t.integer "changeset"
|
|
|
|
t.integer "document"
|
|
|
|
t.integer "attachment"
|
|
|
|
t.integer "issue_done_ratio"
|
|
|
|
t.integer "post_issue"
|
|
|
|
t.integer "score_type"
|
|
|
|
t.integer "total_score"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "project_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "org_activities", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "org_act_id"
|
|
|
|
t.string "org_act_type"
|
|
|
|
t.integer "container_id"
|
|
|
|
t.string "container_type"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "org_courses", :force => true do |t|
|
|
|
|
t.integer "organization_id"
|
|
|
|
t.integer "course_id"
|
|
|
|
t.datetime "created_at"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "org_document_comments", :force => true do |t|
|
|
|
|
t.text "title"
|
|
|
|
t.text "content"
|
|
|
|
t.integer "organization_id"
|
|
|
|
t.integer "creator_id"
|
|
|
|
t.integer "parent_id"
|
|
|
|
t.integer "reply_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.boolean "locked", :default => false
|
|
|
|
t.integer "sticky", :default => 0
|
|
|
|
t.integer "org_subfield_id"
|
|
|
|
t.integer "status", :default => 0
|
|
|
|
t.integer "root_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
add_index "org_document_comments", ["root_id"], :name => "index_org_document_comments_on_root_id"
|
|
|
|
|
|
|
|
create_table "org_member_roles", :force => true do |t|
|
|
|
|
t.integer "org_member_id"
|
|
|
|
t.integer "role_id"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "org_members", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "organization_id"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "org_messages", :force => true do |t|
|
|
|
|
t.integer "user_id"
|
|
|
|
t.integer "sender_id"
|
|
|
|
t.integer "organization_id"
|
|
|
|
t.string "message_type"
|
|
|
|
t.integer "message_id"
|
|
|
|
t.integer "viewed"
|
|
|
|
t.string "content"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.integer "status", :default => 0
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "org_projects", :force => true do |t|
|
|
|
|
t.integer "organization_id"
|
|
|
|
t.integer "project_id"
|
|
|
|
t.datetime "created_at"
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "org_subfield_messages", :force => true do |t|
|
|
|
|
t.integer "org_subfield_id"
|
|
|
|
t.integer "message_id"
|
|
|
|
t.string "message_type"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "org_subfields", :force => true do |t|
|
|
|
|
t.integer "organization_id"
|
|
|
|
t.integer "priority"
|
|
|
|
t.string "name"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.string "field_type"
|
|
|
|
t.integer "hide", :default => 0
|
|
|
|
t.integer "status", :default => 1
|
|
|
|
end
|
|
|
|
|
|
|
|
create_table "organizations", :force => true do |t|
|
|
|
|
t.string "name"
|
|
|
|
t.text "description"
|
|
|
|
t.integer "creator_id"
|
|
|
|
t.integer "home_id"
|
|
|
|
t.boolean "is_public"
|
|
|
|
t.datetime "created_at", :null => false
|
|
|
|
t.datetime "updated_at", :null => false
|
|
|
|
t.boolean "allow_guest_download", :default => true
|
|
|
|
t.integer "visits", :default => 0
|
|
|
|
t.integer "show_mode", :default => 0
|
|
|
|
t.integer "allow_teacher", :default => 0
|
|
|
|
end
|
|
|
|
|