+
+
+
+
+
+
+
+
{{act.author.realname}}
+
{{act.author.nickname}}
+
+
+
+
{{act.latest_update}}
+
+
【问题】{{act.subject|safeHtml}}
+
+
+
状态:{{act.issue_detail.issue_status}} 优先级:{{act.issue_detail.issue_priority}}
+
指派给:{{act.issue_detail.issue_assigned_to}} 完成度:{{act.issue_detail.done_ratio}}%
+
+
+
+
来源: {{act.course_project_name}}
+
+
赞
+
{{act.praise_count}}
+
{{act.praise_count}}
+
+
+
+
+
+
+
-
-
-
-
-
{{r.filename}} 发送
-
暂无课件,
- 请登录Trustie网站,在PC浏览器中上传课件。
-
-
-
授课老师
+
+
+
+
+
+
+
+
{{act.author.realname}}
+
{{act.author.nickname}}
+
+
+
+
{{act.latest_update}}
+
+
【帖子】{{act.subject|safeHtml}}
+
+
+
+
来源: {{act.course_project_name}}
+
+
赞
+
{{act.praise_count}}
+
{{act.praise_count}}
+
+
+
+
+
+
+
-
-
{{teacher.name}} {{teacher.role_name|identify}}
-
+
+
+
+
+
+
{{act.author.realname}} 创建了{{act.course_project_name}} | 项目
+
{{act.latest_update}}
+
+
+
+
+
-
我的同学
-
-
{{student.name}}
-
-
-
-
-
-
{{r.homework_name}} 发送
-
暂无作业,
- 请登录Trustie网站,在PC浏览器中上传作业。
-
-
-
-
{{r.exercise_name}} 发送
-
暂无小测验,
- 请登录Trustie网站,在PC浏览器中上传小测验。
+
-
-
diff --git a/public/javascripts/wechat/controllers/project.js b/public/javascripts/wechat/controllers/project.js
index 5020d040b..569ea3dd3 100644
--- a/public/javascripts/wechat/controllers/project.js
+++ b/public/javascripts/wechat/controllers/project.js
@@ -1,64 +1,137 @@
-app.controller('ProjectController', ['$scope', 'config','$http', 'auth','$location','$routeParams','alertService','rms', function($scope, config, $http, auth, $location, $routeParams,alertService,rms){
+app.controller('ProjectController', ['$scope', 'config','$http','$timeout', 'auth','$location','$routeParams','alertService','rms','common', function($scope, config, $http,$timeout, auth, $location, $routeParams,alertService,rms,common){
+ $scope.replaceUrl = function(url){
+ return url;
+ };
var vm = $scope;
var projectid = $routeParams.id;
- vm.project_activities = [];
- vm.project_activities_page = 0;
+ vm.project_activities_page = rms.get('project_activities_page') || 0;
+ vm.project_activities = rms.get("project_activities") || [];
+ vm.project_has_more = rms.get("project_has_more");
+ vm.project = rms.get("project")
vm.project_members = [];
vm.project_members_page = 0;
+ vm.alertService = alertService.create();
+
+ //获取项目动态
+ vm.getActivities = function(page){
+ $http({
+ method: 'POST',
+ url: apiUrl + "projects/activities?id=" + projectid,
+ data:{token:auth.token(),page:page}
+ }).then(function successCallback(response) {
+ console.log(response.data);
+ vm.project_activities_page = response.data.page;
+ if(response.data.page > 0)
+ {
+ vm.project_activities = vm.project_activities.concat(response.data.data);
+ }
+ else{
+ vm.project_activities = response.data.data;
+ vm.project_activities_page = 0;
+ vm.project_has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
+ }
- vm.currentTab = 1;
+ }, function errorCallback(response) {
+ });
+ }
+
+ //跳到详情页
+ vm.goDetail = function(type, act_id,id){
+ rms.save("yoffset", document.documentElement.scrollTop);
+ rms.save("project_activities",vm.project_activities);
+ rms.save("project",vm.project);
+ $location.path('/'+type+'/'+act_id);
+ }
+
+ //切换 按钮
vm.tab = function(index){
vm.currentTab = index;
vm.searchText = '';
if(index == 1){
- $http.get(config.apiUrl + 'project/activities?token='+auth.token()+'&project_id='+projectid).then(
- function(response) {
- console.log(response.data);
- vm.project_activities = response.data.data;
- }
- )
+ vm.getActivities(0);
}
else if(index == 2){
- $http.get(config.apiUrl + 'project/members?token='+auth.token()+'&project_id='+projectid).then(
+ $http.get(config.apiUrl + 'projects/members?token='+auth.token()+'&project_id='+projectid).then(
function(response) {
console.log(response.data);
vm.project_activities = response.data.data;
}
)
}
+
+ rms.save("tab_num",$scope.currentTab);
};
+ //初始化TAB按钮
+ var resetMenu = function(can_setting){
+ if(can_setting){
+ vm.menus = ["项目动态", "成员管理"];
+ } else {
+ vm.menus = ['项目动态', "我的伙伴"];
+ }
- $http.get(config.apiUrl+ 'project/'+projectid+"?token="+auth.token()).then(
- function(response) {
- console.log(response.data);
+ }
+ if(vm.project){
+ resetMenu(vm.project.can_setting);
+ }
- if (response.data.status == 0){
- vm.project = response.data.data;
- resetMenu(vm.project.can_setting);
- vm.tab(1);
- }
- else{
- vm.alertService.showMessage('提示', response.data.message);
+ vm.currentTab = rms.get('tab_num');
+
+ //
+ if(!vm.currentTab){
+ $http.get(config.apiUrl+ 'projects/'+projectid+"?token="+auth.token()).then(
+ function(response) {
+ console.log(response.data);
+
+ if (response.data.status == 0){
+ vm.project = response.data.data;
+ resetMenu(vm.project.can_setting);
+ vm.tab(1);
+ }
+ else{
+ vm.alertService.showMessage('提示', response.data.message,function(){
+ window.history.back();
+ });
+
+ }
}
+ );
+ vm.currentTab = 1;
+ vm.tab(vm.currentTab);
+ } else {
+ $timeout(function(){
+ window.scrollTo(0, rms.get("yoffset"));
+ });
+ }
+ vm.addPraise = function(act){
+ for(var i in vm.project_activities){
+ if(vm.project_activities[i].act_id == act.act_id){
+ vm.project_activities[i].praise_count += 1;
+ vm.project_activities[i].has_praise = true;
+ break;
+ }
}
- );
+ common.addCommonPraise(act);
+ };
- var resetMenu = function(can_setting){
- if(can_setting){
- vm.menus = ["项目动态", "成员管理"];
- } else {
- vm.menus = ['项目动态', "我的伙伴"];
+ vm.decreasePraise = function(act){
+ for(var i in vm.project_activities){
+ if(vm.project_activities[i].act_id == act.act_id){
+ vm.project_activities[i].praise_count -= 1;
+ vm.project_activities[i].has_praise = false;
+ break;
+ }
}
- }
+ common.decreaseCommonPraise(act);
+ };
}]);
\ No newline at end of file
From 652e56dec42c4e862f1b8a5d4011d938619ab200 Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Mon, 25 Jul 2016 18:16:47 +0800
Subject: [PATCH 018/108] =?UTF-8?q?=E5=BF=BD=E7=95=A5wechat.yml?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.gitignore | 1 +
config/{wechat.yml => wechat.yml.template} | 0
2 files changed, 1 insertion(+)
rename config/{wechat.yml => wechat.yml.template} (100%)
diff --git a/.gitignore b/.gitignore
index 1ef7e63ce..8a40f3ca7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,3 +36,4 @@ public/javascripts/wechat/node_modules/
.ruby-version
.access_token
tmux*.log
+config/wechat.yml
diff --git a/config/wechat.yml b/config/wechat.yml.template
similarity index 100%
rename from config/wechat.yml
rename to config/wechat.yml.template
From 5883b451cabeb4a05e6f5aa939223035e2c331d3 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Mon, 25 Jul 2016 18:31:28 +0800
Subject: [PATCH 019/108] =?UTF-8?q?=E5=9C=A8=E7=AE=A1=E7=90=86=E5=91=98?=
=?UTF-8?q?=E7=95=8C=E9=9D=A2=E6=B7=BB=E5=8A=A0=E5=8D=95=E4=BD=8D=E5=90=8D?=
=?UTF-8?q?=E7=A7=B0=E5=88=97=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/admin_controller.rb | 40 +-
app/views/admin/_tab_has_applied_applied.erb | 6 +
app/views/admin/applied_schools.html.erb | 76 +
app/views/admin/has_applied_schools.html.erb | 75 +
config/routes.rb | 3 +-
db/schema.rb | 4590 +++++++++---------
6 files changed, 2498 insertions(+), 2292 deletions(-)
create mode 100644 app/views/admin/_tab_has_applied_applied.erb
create mode 100644 app/views/admin/applied_schools.html.erb
create mode 100644 app/views/admin/has_applied_schools.html.erb
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb
index 6d55cca53..8822ca794 100644
--- a/app/controllers/admin_controller.rb
+++ b/app/controllers/admin_controller.rb
@@ -602,14 +602,47 @@ class AdminController < ApplicationController
# 获取申请的高校列表
# status: 0 未审批; 1 已批阅;
def applied_schools
- @apply_status = ApplyAddSchools.where(:status => 0)
+ @name = params[:name]
+ @apply_status = ApplyAddSchools.where(:status => 0).order('created_at desc')
+ @apply_count = @apply_status.count
+
+ @apply_pages = Paginator.new @apply_count, 30, params['page'] || 1
+ @apply_status = paginateHelper @apply_status, 30
+
+ @page = (params['page'] || 1).to_i - 1
+ respond_to do |format|
+ format.html
+ end
+ end
+
+ def has_applied_schools
+ @name = params[:name]
+ @has_apply_status = ApplyAddSchools.where(:status => 1).order('created_at desc')
+ @has_apply_count = @has_apply_status.count
+
+ @has_apply_pages = Paginator.new @has_apply_count, 30, params['page'] || 1
+ @has_apply_status = paginateHelper @has_apply_status, 30
+
+ @page = (params['page'] || 1).to_i - 1
+ respond_to do |format|
+ format.html
+ end
+ end
+
+ # 批准未审批的高校
+ def approve_applied_schools
+ @applied_schools = ApplyAddSchools.find params[:id]
+ unless @applied_schools_schools.nil?
+ @applied_schools.update_column('status', 1)
+ end
end
# 更改申请的高校名称
# REDO: 修改该字段
# REDO: 同步修改使用了改名称的用户单位
def edit_applied_schools
-
+ @applied_schools = ApplyAddSchools.find params[:id]
+ @applied_schools.update_column('name', params[:name])
end
# 删除申请的高校
@@ -617,7 +650,8 @@ class AdminController < ApplicationController
# REDO: 删除确认提示,是否删除
# REDO: 给申请人发送消息
def delete_applied_schools
-
+ @applied_schools = ApplyAddSchools.find params[:id]
+ @applied_schools.destroy
end
#移动端版本管理
diff --git a/app/views/admin/_tab_has_applied_applied.erb b/app/views/admin/_tab_has_applied_applied.erb
new file mode 100644
index 000000000..6ae501b0c
--- /dev/null
+++ b/app/views/admin/_tab_has_applied_applied.erb
@@ -0,0 +1,6 @@
+
+
+ <%= link_to '未审批', {:action => 'applied_schools'}, class: "#{current_page?(unapplied_schools_path)? 'selected' : nil }" %>
+ <%= link_to '已审批', {:action => 'has_applied_schools'}, class: "#{current_page?(applied_schools_path)? 'selected' : nil }" %>
+
+
\ No newline at end of file
diff --git a/app/views/admin/applied_schools.html.erb b/app/views/admin/applied_schools.html.erb
new file mode 100644
index 000000000..89940ac35
--- /dev/null
+++ b/app/views/admin/applied_schools.html.erb
@@ -0,0 +1,76 @@
+
+ <%=l(:label_applied_shcools)%>
+
+
+<%= render 'tab_has_applied_applied' %>
+
+<%= form_tag({}, :method => :get) do %>
+
+
+ 单位名称:
+
+ <%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '输入单位名称进行搜索' %>
+ <%= submit_tag l(:button_apply ), :class => "small", :name => nil %>
+ <%= link_to l(:button_clear), {:controller => 'admin', :action => 'applied_shcools'}, :class => 'icon icon-reload' %>
+
+<% end %>
+
+
+
\ No newline at end of file
diff --git a/app/views/admin/has_applied_schools.html.erb b/app/views/admin/has_applied_schools.html.erb
new file mode 100644
index 000000000..2e9e3fe96
--- /dev/null
+++ b/app/views/admin/has_applied_schools.html.erb
@@ -0,0 +1,75 @@
+
+ <%=l(:label_applied_shcools)%>
+
+
+<%= render 'tab_has_applied_applied' %>
+
+<%= form_tag({}, :method => :get) do %>
+
+
+ 单位名称:
+
+ <%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '输入单位名称进行搜索' %>
+ <%= submit_tag l(:button_apply ), :class => "small", :name => nil %>
+ <%= link_to l(:button_clear), {:controller => 'admin', :action => 'applied_shcools'}, :class => 'icon icon-reload' %>
+
+<% end %>
+
+
+
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index b969b7fca..e98749334 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1069,7 +1069,8 @@ RedmineApp::Application.routes.draw do
match 'admin/default_configuration', :via => :post
get 'admin/organization'
get 'admin/schools'
- get 'admin/applied_schools'
+ get 'admin/applied_schools', as: :unapplied_schools
+ get 'admin/has_applied_schools', as: :applied_schools
get 'admin/leave_messages'
match 'admin/messages_list', as: :messages_list
match 'admin/project_messages', as: :project_messages
diff --git a/db/schema.rb b/db/schema.rb
index 3a92d4fc0..1a18dfbaa 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1,2288 +1,2302 @@
-# 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.
-
-ActiveRecord::Schema.define(:version => 20160720094503) do
-
- 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_projects", :force => true do |t|
- t.integer "project_id", :null => false
- t.integer "user_id", :null => false
- end
-
- 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
- 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
-
- 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.string "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"
- 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
- t.datetime "created_on"
- t.string "description"
- t.string "disk_directory"
- t.integer "attachtype", :default => 1
- t.integer "is_public", :default => 1
- t.integer "copy_from"
- t.integer "quotes"
- t.integer "is_publish", :default => 1
- t.date "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"
-
- 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
- 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"
- 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
-
- 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"
- 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
-
- 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 "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 "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.string "name"
- t.string "budget", :default => ""
- t.integer "author_id"
- t.date "deadline"
- t.string "description"
- t.integer "commit"
- t.string "password"
- t.datetime "created_on", :null => false
- t.datetime "updated_on", :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
-
- 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
-
- 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_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"
-
- 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"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- 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"
- t.integer "status", :default => 1
- t.integer "attachmenttype", :default => 2
- t.integer "lft"
- t.integer "rgt"
- 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
- t.integer "end_time"
- t.string "end_term"
- t.integer "is_excellent", :default => 0
- t.integer "excellent_option", :default => 0
- t.integer "is_copy", :default => 0
- t.integer "visits", :default => 0
- t.integer "syllabus_id"
- t.string "invite_code"
- t.string "qrcode"
- 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 "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 "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
-
- 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"
-
- 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
- end
-
- 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"
- end
-
- 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"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.datetime "publish_time"
- t.datetime "end_time"
- t.integer "show_result"
- end
-
- 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"
- 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
-
- 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 "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"
-
- create_table "homework_commons", :force => true do |t|
- t.string "name"
- t.integer "user_id"
- t.text "description"
- t.date "publish_time"
- t.date "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"
- end
-
- add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id"
-
- 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"
- t.date "evaluation_start"
- t.date "evaluation_end"
- t.integer "evaluation_num"
- t.integer "absence_penalty", :default => 1
- t.integer "homework_common_id"
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- 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"
-
- 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
-
- 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
- end
-
- 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 "member_roles", :force => true do |t|
- t.integer "member_id", :null => false
- t.integer "role_id", :null => false
- t.integer "inherited_from"
- 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
- end
-
- 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|
- t.integer "forum_id", :null => false
- t.integer "parent_id"
- t.string "subject", :null => false
- t.text "content", :null => false
- t.integer "author_id", :null => false
- t.integer "replies_count", :default => 0
- t.integer "last_reply_id"
- 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
- end
-
- 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|
- t.integer "board_id", :null => false
- t.integer "parent_id"
- t.string "subject", :default => "", :null => false
- t.text "content"
- t.integer "author_id"
- t.integer "replies_count", :default => 0, :null => false
- t.integer "last_reply_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.integer "quotes"
- t.integer "status", :default => 0
- 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"
-
- 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"
- 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
- end
-
- 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
-
- 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"
- 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 "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"
- 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 "commits_count", :default => 0
- t.integer "publish_resource", :default => 0
- t.integer "issues_count", :default => 0
- t.integer "attachments_count", :default => 0
- t.integer "boards_count", :default => 0
- t.integer "news_count", :default => 0
- t.integer "acts_count", :default => 0
- t.integer "journals_count", :default => 0
- t.integer "boards_reply_count", :default => 0
- t.integer "visits", :default => 0
- t.integer "hot", :default => 0
- 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 "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"
- 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 "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
- 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
-
- 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
- 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
- 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_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 "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 "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
-
- 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
- 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
- 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 "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_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
+# 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.
+
+ActiveRecord::Schema.define(:version => 20160725091759) do
+
+ 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_projects", :force => true do |t|
+ t.integer "project_id", :null => false
+ t.integer "user_id", :null => false
+ end
+
+ 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
+
+ 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.string "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"
+ 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
+ t.datetime "created_on"
+ t.string "description"
+ t.string "disk_directory"
+ t.integer "attachtype", :default => 1
+ t.integer "is_public", :default => 1
+ t.integer "copy_from"
+ t.integer "quotes"
+ t.integer "is_publish", :default => 1
+ t.date "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"
+
+ 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
+ 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"
+ 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
+
+ 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
+
+ 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 "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_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 "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.string "name"
+ t.string "budget", :default => ""
+ t.integer "author_id"
+ t.date "deadline"
+ t.string "description"
+ t.integer "commit"
+ t.string "password"
+ t.datetime "created_on", :null => false
+ t.datetime "updated_on", :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
+
+ 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
+
+ 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_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"
+
+ 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"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ 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"
+ t.integer "status", :default => 1
+ t.integer "attachmenttype", :default => 2
+ t.integer "lft"
+ t.integer "rgt"
+ 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
+ t.integer "end_time"
+ t.string "end_term"
+ t.integer "is_excellent", :default => 0
+ t.integer "excellent_option", :default => 0
+ t.integer "is_copy", :default => 0
+ t.integer "visits", :default => 0
+ t.integer "syllabus_id"
+ t.string "invite_code"
+ t.string "qrcode"
+ 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 "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 "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
+
+ 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"
+
+ 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
+ end
+
+ 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"
+ end
+
+ 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"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.datetime "publish_time"
+ t.datetime "end_time"
+ t.integer "show_result"
+ end
+
+ 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"
+ 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
+
+ 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 "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"
+
+ create_table "homework_commons", :force => true do |t|
+ t.string "name"
+ t.integer "user_id"
+ t.text "description"
+ t.date "publish_time"
+ t.date "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"
+ end
+
+ add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id"
+
+ 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"
+ t.date "evaluation_start"
+ t.date "evaluation_end"
+ t.integer "evaluation_num"
+ t.integer "absence_penalty", :default => 1
+ t.integer "homework_common_id"
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ 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"
+
+ 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
+
+ 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
+ end
+
+ 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 "member_roles", :force => true do |t|
+ t.integer "member_id", :null => false
+ t.integer "role_id", :null => false
+ t.integer "inherited_from"
+ 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
+ end
+
+ 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|
+ t.integer "forum_id", :null => false
+ t.integer "parent_id"
+ t.string "subject", :null => false
+ t.text "content", :null => false
+ t.integer "author_id", :null => false
+ t.integer "replies_count", :default => 0
+ t.integer "last_reply_id"
+ 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
+ end
+
+ 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|
+ t.integer "board_id", :null => false
+ t.integer "parent_id"
+ t.string "subject", :default => "", :null => false
+ t.text "content"
+ t.integer "author_id"
+ t.integer "replies_count", :default => 0, :null => false
+ t.integer "last_reply_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.integer "quotes"
+ t.integer "status", :default => 0
+ 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"
+
+ 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"
+ 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
+ end
+
+ 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
+
+ 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"
+ 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 "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"
+ 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 "commits_count", :default => 0
+ t.integer "publish_resource", :default => 0
+ t.integer "issues_count", :default => 0
+ t.integer "attachments_count", :default => 0
+ t.integer "boards_count", :default => 0
+ t.integer "news_count", :default => 0
+ t.integer "acts_count", :default => 0
+ t.integer "journals_count", :default => 0
+ t.integer "boards_reply_count", :default => 0
+ t.integer "visits", :default => 0
+ t.integer "hot", :default => 0
+ 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 "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"
+ 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 "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
+ 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
+
+ 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
+ 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
+ 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_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 "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 "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
+
+ 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
+ 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
+ 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 "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_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
From 463c09f02ce609ad4c64ca209a62ff4c4997989c Mon Sep 17 00:00:00 2001
From: huang
Date: Tue, 26 Jul 2016 08:55:07 +0800
Subject: [PATCH 020/108] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=82=80=E8=AF=B7?=
=?UTF-8?q?=E5=BC=B9=E6=A1=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Gemfile | 2 +-
app/controllers/applied_project_controller.rb | 75 +++++++-------
app/helpers/watchers_helper.rb | 27 +++--
.../_applied_join_project.html.erb | 28 ++++++
.../applied_join_project.js.erb | 21 ++--
config/routes.rb | 4 +-
public/images/sy/sy_icons_close02.png | Bin 0 -> 18724 bytes
public/javascripts/application.js | 16 +++
public/stylesheets/css/common.css | 31 ++++++
public/stylesheets/css/popup.css | 93 +++++++++++++++++-
public/stylesheets/sy_public.css | 56 +++++------
11 files changed, 260 insertions(+), 93 deletions(-)
create mode 100644 app/views/applied_project/_applied_join_project.html.erb
create mode 100644 public/images/sy/sy_icons_close02.png
diff --git a/Gemfile b/Gemfile
index 03dbb5785..a94f1b33b 100644
--- a/Gemfile
+++ b/Gemfile
@@ -51,7 +51,7 @@ gem 'elasticsearch-rails'
### profile
-gem 'oneapm_rpm'
+# gem 'oneapm_rpm'
group :development do
gem 'grape-swagger'
diff --git a/app/controllers/applied_project_controller.rb b/app/controllers/applied_project_controller.rb
index b9824976b..39491c0e6 100644
--- a/app/controllers/applied_project_controller.rb
+++ b/app/controllers/applied_project_controller.rb
@@ -2,44 +2,45 @@ class AppliedProjectController < ApplicationController
#申请加入项目
def applied_join_project
- @user_id = params[:user_id]
- @project = Project.find_by_id(params[:project_id])
- if params[:project_join]
- if @project
- user = User.find @user_id
- if user.member_of?(@project)
- @status = 3
- else
- @applieds = AppliedProject.where("user_id = ? and project_id = ?", params[:user_id],params[:project_id])
- if @applieds.count == 0
- appliedproject = AppliedProject.create(:user_id => params[:user_id], :project_id => params[:project_id])
- Mailer.run.applied_project(appliedproject)
- @status = 2
- else
- @status = 1
- end
- end
- else
- @status = 0
- end
- respond_to do |format|
- format.js
- end
- return
- end
-
- @applieds = AppliedProject.where("user_id = ? and project_id = ?", params[:user_id],params[:project_id])
- if @applieds.count == 0
- appliedproject = AppliedProject.create(:user_id => params[:user_id], :project_id => params[:project_id])
- Mailer.run.applied_project(appliedproject)
- end
- #redirect_to project_path(params[:project_id])
- #redirect_to_referer_or {render :text => ( 'applied success.'), :layout => true}
- respond_to do |format|
- format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
- format.js { render :partial => 'set_applied'}
- end
+ # @user_id = params[:user_id]
+ # @project = Project.find_by_id(params[:project_id])
+ # if params[:project_join]
+ # if @project
+ # user = User.find @user_id
+ # if user.member_of?(@project)
+ # @status = 3
+ # else
+ # @applieds = AppliedProject.where("user_id = ? and project_id = ?", params[:user_id],params[:project_id])
+ # if @applieds.count == 0
+ # appliedproject = AppliedProject.create(:user_id => params[:user_id], :project_id => params[:project_id])
+ # Mailer.run.applied_project(appliedproject)
+ # @status = 2
+ # else
+ # @status = 1
+ # end
+ # end
+ # else
+ # @status = 0
+ # end
+ # respond_to do |format|
+ # format.js
+ # end
+ # return
+ # end
+ #
+ # @applieds = AppliedProject.where("user_id = ? and project_id = ?", params[:user_id],params[:project_id])
+ # if @applieds.count == 0
+ # appliedproject = AppliedProject.create(:user_id => params[:user_id], :project_id => params[:project_id])
+ # Mailer.run.applied_project(appliedproject)
+ # end
+ #
+ # #redirect_to project_path(params[:project_id])
+ # #redirect_to_referer_or {render :text => ( 'applied success.'), :layout => true}
+ # respond_to do |format|
+ # format.html { redirect_to_referer_or {render :text => (watching ? 'Watcher added.' : 'Watcher removed.'), :layout => true}}
+ # format.js { render :partial => 'set_applied'}
+ # end
end
#取消申请
diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb
index 52f2ea119..823fe534b 100644
--- a/app/helpers/watchers_helper.rb
+++ b/app/helpers/watchers_helper.rb
@@ -366,20 +366,27 @@ module WatchersHelper
#申请加入项目
def join_in_project_link(project, user, options=[])
- return '' unless user && user.logged?
applied = project.applied_projects.find_by_user_id(user.id)
text = applied ? l(:label_unapply_project) : l(:label_apply_project)
- @applied_flag = project.instance_of?(Project)
+ url = applied ? unapplied_join_project_path(:object_id => project.id) : applied_join_project_path(:object_id => project.id)
+ method = applied ? 'delete' : 'post'
+ @applied_flag = project.instance_of?(Project)
if applied
- appliedid = applied.id
+ link = link_to(text, url, :remote => true, :method => method, :class => "sy_btn_grey fl", :id => "#{project.id}")
+ else
+ link = link_to(text, url, :remote => true, :method => method, :id => "#{project.id}", :class => "sy_btn_grey fl")
end
- id = applied_css(project)
- url = appliedproject_path(
- :id=>appliedid,
- :user_id => user.id,
- :project_id => project.id)
- method = applied ? 'delete' : 'post'
- link_to text, url, :remote => true, :method => method , :class => "pr_join_a",:id => id
+ link.html_safe
+ # if applied
+ # appliedid = applied.id
+ # end
+ # id = applied_css(project)
+ # url = appliedproject_path(
+ # :id=>appliedid,
+ # :user_id => user.id,
+ # :project_id => project.id)
+ # method = applied ? 'delete' : 'post'
+ # link_to text, url, :remote => true, :method => method , :class => "pr_join_a",:id => id
end
def paginateHelper obj, pre_size=20
diff --git a/app/views/applied_project/_applied_join_project.html.erb b/app/views/applied_project/_applied_join_project.html.erb
new file mode 100644
index 000000000..baa49ef01
--- /dev/null
+++ b/app/views/applied_project/_applied_join_project.html.erb
@@ -0,0 +1,28 @@
+
+
+
diff --git a/app/views/applied_project/applied_join_project.js.erb b/app/views/applied_project/applied_join_project.js.erb
index ae9d3f467..f79e9ac20 100644
--- a/app/views/applied_project/applied_join_project.js.erb
+++ b/app/views/applied_project/applied_join_project.js.erb
@@ -1,14 +1,7 @@
-// @status: 0 该项目不存在;1 不重复加入;2 成功加入; 3 已是项目成员;其它 加入失败
-<% if @status == 0%>
- alert("<%= l('project.join.tips.notexist') %>");
-<% elsif @status == 1%>
- alert("<%= l('project.join.tips.repeat') %>");
-<% elsif @status == 2%>
- alert("<%= l('project.join.tips.success') %>");
- hideModal($("#popbox"));
- $("#applied_project_link_<%= @project.id%>").replaceWith("<%=escape_javascript(link_to '取消申请',appliedproject_applied_path(:project_id => @project.id,:user_id => User.current.id),:class => "blue_n_btn fr mt20", :remote => "true",:method => "delete",:id => "applied_project_link_#{@project.id}")%>");
-<% elsif @status == 3%>
- alert("<%= l('project.join.tips.has') %>");
-<%else%>
- alert("<%= l('project.join.tips.fail') %>");
-<%end%>
\ No newline at end of file
+$('#ajax-modal').html('<%= escape_javascript(render :partial => 'applied_join_project', locals: { :course => @course}) %>');
+showModal('ajax-modal', '500px');
+
+$('#ajax-modal').siblings().remove();
+
+$('#ajax-modal').parent().css("top","").css("left","");
+
diff --git a/config/routes.rb b/config/routes.rb
index 1124080b7..4b9027335 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -721,8 +721,8 @@ RedmineApp::Application.routes.draw do
post 'issues/:object_id/watchers', :to => 'watchers#create', :object_type => 'issue'
delete 'issues/:object_id/watchers/:user_id' => 'watchers#destroy', :object_type => 'issue'
- post 'appliedproject/applied', :to => 'applied_project#applied_join_project', :as => 'appliedproject'
- delete 'appliedproject/applied', :to => 'applied_project#unapplied_join_project'
+ post 'applied_project/applied_join', :to => 'applied_project#applied_join_project', :as => 'applied_join_project'
+ delete 'applied_project/applied', :to => 'applied_project#unapplied_join_project', :as => 'unapplied_join_project'
resources :projects do
member do
diff --git a/public/images/sy/sy_icons_close02.png b/public/images/sy/sy_icons_close02.png
new file mode 100644
index 0000000000000000000000000000000000000000..456f2ea67183dcba533dfed2c7591e2b37b9c787
GIT binary patch
literal 18724
zcmeI43pAA7*T5g7P$btPVWhWW%mp)MVqD88B6ms|GlR+8niCj
zbP?qiMM6c}3IIXP$qs?8(L)M^wjt_lXS1e(3vu*q08ArGtU}uDr1TMhv{PEf
zq-@t-31>O^IY~sPTiY8Xh{=1Or7kY;G2Oq{{eaUtgV(C98JD(%^!N3Be)#!XcT)FA
zO>ph(@HsMz4nIG+5y08+GQ>BjM%of@-6;wemM6APQ+rt${wiDajcL7D&_*Y4u4Z5fEWOv2Zx%$
zfU}Z7?|UnPDA1G{-Kq#Qot&R31{@Ls;ul*k6gIgEcsgyf*A_0l0inyEs~0?FKN%*z}{6r6aq>sW2@s<
z)$7U?#NJa1d^^zoO#Rsn`UNwR;u2|Z@lIG$T%v|7v0KEtW)=V_4cA@&YG54I{k-$(
zbMJ0?|NF9&U;PGHFoODd`Oa(Sedc)^6L<)t6^ns-%~Oy%rKaAmv&g0GNcmgCA6yc^HuP(L)Ch
z0YG%gaHNTr5KtYL-T?sDUd&y0CPvZvwip0dq;6Z9YdT}rb-Aoksif;F*Gd(INz*M%
zW-Tl=ls22*89ra)#N4B%^Bha@P17#riYTSdNq8!qcO7LQ+1)O)Zd(sqak}T+lpAxe
z?G~SAS|KJ&QpfL|;}y{as}WO-kC+A{5%rFQr>ni(E4Kz#R>4UZ&NSP2*n_C?7S55w
z9a?AdDXOJH4ZVM4|20cg%(jbbL>>tHn_M}gsBEM2W#&Ch7|YUIfjin)mI*onIF7cBaWZJuU`%r`p{-_G`4L-)@N|cCLcKIC$$C*w6ywg5PO*#O
zS!!{I^P^@**&g|P=VoWV9KLMtGi&ja3+>ZmWLD}^jk~6uI*vArPd&S)Iy2>g*x9}K
zO=+e%5->I!@UHW4{gX7@sd|4{&>fN<#G4o>iu5Kc-j4O
z$NRuplDj2$loP!c&-0tNd0xic{CS9Y>(iq5J_~RV-3Z3==hvjxrz*R7H_r_#LAa)D7%>dS*_gZ{guvzG-zfQkiP^UT5*clB&*UPP)GrxyU^b(AM|vfC6MCoj;XaT)XntUP
zs8y+&FQd}9jJGV5!}G5SptG;_q(9ZWnRzSo=1UhJWuFt=w>+O;sJq
z8HpJ;-bHmI)(5P2TmQLef$iT(i&7eqjEa_9Yuk$|H+$jV42ut&F_Q9m*{8}cksnK*2ESE!vs%bzQ$=fK;<8`5sf>U8_;Qxx$gGV|b-
zWi1;oa{_#_Hq!0sd6bh9|pFyl-FUt)^Q>`#QM7-ShSL?|uiqBuxRHg(Py6L+`g&OQSCKGqjxNC=+nH^%TZC3`-1C#7JG
zIHMJ`cJA7s0%8%-{eft2Z=+4hA!to1d)AzuVVC>`CuoW(~QOoL^bA
z(X`>-?g7bc<
zONrckYV(W_%lmsa@>ulN^Ccx0#ToXPLkoy_c2{CJt2wbRA@CC0eW}z9)2{1(wVe*#
z++p|PM9t0Co7HXcTk{9SdWgYV_4pG1EO;6t)#yY~|BHiZ$tvqrEQ|BMh4rI4$o}Q}
zkuE8z$%~EN40mpi?#Q5Iq$IC4HhK`>8a!k@67T1+#-qr`yf(#Hk@wmyAnDe*b
z9`3pBwlB{x$3o=V52vuN3v^Lw)7YD7q*ob
zsm3oJG5KouuI>}LJma425TQHt>j+|K=ey6E^~ZI=yU*)1M^~P!jWwRkV(5@4EHA1~
z5Q7cghJrfdAU28YN9Cz`QGIAkBUt~{5||o|Vgz&1w?W#l&8faLVhD%o5VG2l9O6gD
zQDDXd3Bw>f=zu}xk<@}1bS4)cWCR=YiwD1tHX~qaV_kTDMljRS0o7b>?9|Lz9IBeW
z4hBv}Vz6phoDNDKi`BzwtD%u7eFRb$p^Jp0b@6&gydGNZ`yY%T0e&;&P`vT>7Aw9F
z2TDdTUmlN*M<4krBfN82^YM0
z)Ne0={p0-c(|pQh{8ayO_B@*R#Nte`9o78Nj2cAygW0HN+-xiq##hJ?j6b|Nhf3nH
zIF2k9oiH9{6Q?Ke@H84#YKvWHObRQIyTlLyHJMoN32#&j5|2s%EirH;7LG6q^JXy~Gjq#$Q;reJK8ID3xF>nJU2@5CTyeK$|
zE*7JwkNGjsBxk=2WXl2XjhQ6+q&}l_p@4&VdE>BDGzkUw!g+zqh1T;x}%78Hz~bg3%N_DaycD8_PTn)J;=ce<jc9_d3-K>fR7Bnycxw|AU3#k^=sB%b<@jpkT0Q5}ZuY
zMZvM&dIoSWaF@aL&=@2VNyg$R2G}3V{9nEd6H!d|B{6-d6awPM%ziZdH?7=1%ZLBt
z4fJc~|Nq-S|Jurp@5HG&@kgHhHHR8f$arrShe6^IXbh4M6~Siu7$PPbC!)o0qI#IK
z=q!#6i$W#n8X|tz{97yV7gM|OA4~~cdrLDltL5ex6b^%dqjgY|-AwBDTR%T)jVV|=
zM@s^CYR(xe31%dpsjZ`Uzh|i5S43SZ27}W@8i4f)MH#P%BrMecPSV#$8F=f1#TN%A
ziQgr;@z$v$PM#0H>opv`>%xQO4@||Rv9bfA_@!+UhB2M%Xc?pXkM+l*!5oG}phn-n
zn@(0kP2KpLPF6!rCoG+qG#&vg-eVU7X`W;?dTWRuixmg(6hkF|Q-d}^d)v{1sB~8g
z8hG=<9WBBba86@3P{nTz-6jmtQw%35z8j7&+N86_Sh$S0f+rd95QX@8iuxszewO}!
z^UK7H{!OnCUxGm(K=_LST>SY!v;tfZApAuEF8+KVS^+Ky5dNY77k@qwtpFDU2!Bz4
zi$5QTR)7lvguf`j#h(vEE5HQ-!e12N;?D=772tvZ;V%ks@#h243UEPy@D~NR`165i
z1-KwU_=^Hu{P{q%0$dOv{6zsS{(K->0WJs-{-OXEe?Abc02c%Ze^G#oKOcxzfC~bI
zzbL@PpASSUzy$%qUlict&j+Fv;DP|*FA8w+=L69Sa6y3Z7X`TZ^MPmuxFA6IivnEy
z`9QP+To54qMFB4Ud>~o@E(j3*q5v0vJ`k+{7X%1@kuNTZiRY53Oz>gkK=7$!arKbV
z|D~fwCfeHoK!_#)gzo@=;cwvQO91dk0>CRz0Kgvu07cf34P`3;Kxn6xg{fmub7zz3
z>YGUET~ABqxV(Uen@cx7wwE$BeT&nU-?Z=IV8RU*U)EvsnCgX`j!kH{X)b5uY}OUo
z%GRcPB(44{hvu~IQK1mK2EI*Y;8l^aJ9b$&b6cQiUlHrM#1;4K!cg^{9Xq#p6ib`Q
zx_p!k0*XaR*PjTrU1VXoq{7hcxtFxS-$}>8Y^LTmcDt`v(8i8*}g
z$J_qn4KF|c=$oFwhf3mVOAUcEV*&?adWHXt1WWOJh%S`5G2^?
literal 0
HcmV?d00001
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index b7468366a..e86ad8ddc 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -1492,6 +1492,22 @@ function pop_up_box(value,tWidth,tTop,tLeft){
}
}
+// 公共弹框样式
+// title
+function pop_box_new(value, tWidth, tTop, tLeft){
+ $("#ajax-modal").html(value);
+ showModal('ajax-modal', tWidth + "px");
+ $('#ajax-modal').siblings().remove();
+ $('#ajax-modal').before(" ");
+ $('#ajax-modal').parent().css("top", tTop+"%").css("left", tLeft+"%").css("padding-top", "10px").css("position", "fixed");
+ $('#ajax-modal').parent().addClass("resourceUploadPopup");
+ $('#ajax-modal').css("padding-left", "16px").css("padding-bottom", "16px");
+
+ function hideModal(){
+ $('#ajax-modal').hide();
+ }
+}
+
//显示的时候根据当前网址是http 还是https 选择视频显示方式直接显示还是弹框
function autoMedia(id){
var rootPath = getRootPath();
diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css
index b72a8ef56..888cb3ca3 100644
--- a/public/stylesheets/css/common.css
+++ b/public/stylesheets/css/common.css
@@ -542,6 +542,37 @@ a:hover.BlueCirBtnMini{ background:#269ac9; color:#fff;}
.borderRadius {border-radius:5px;}
a.Blue-btn{ display:block; margin-right:15px;width:65px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
a:hover.Blue-btn{ background:#3598db; color:#fff;}
+
+/*20160725 项目申请按钮*/
+a.sy_btn_grey{
+ color: #333;
+ background: #e1e1e1;
+ text-align: center;
+ font-size: 12px;
+ padding:0 15px;
+ height: 30px;
+ line-height: 30px;
+ -webkit-border-radius:3px;
+ -moz-border-radius:3px;
+ -o-border-radius:3px;
+ border-radius:3px;
+}
+a:hover.sy_btn_grey{ background: #c3c3c3;}
+a.sy_btn_blue{
+ display:block;
+ width:80px;
+ height: 30px;
+ text-align:center;
+ color: #fff;
+ background: #3b94d6;
+ font-size: 12px;
+ line-height: 30px;
+ -webkit-border-radius:3px;
+ -moz-border-radius:3px;
+ -o-border-radius:3px;
+ border-radius:3px;
+}
+a:hover.sy_btn_blue{ background: #2788d0;}
/* commonpic */
.pic_date{ display:block; background:url(/images/public_icon.png) -31px 0 no-repeat; width:16px; height:15px; }
.pic_add{ display:block; background:url(/images/public_icon.png) -31px -273px no-repeat; width:16px; height:15px; }
diff --git a/public/stylesheets/css/popup.css b/public/stylesheets/css/popup.css
index ea2034a5e..c9f8ccf09 100644
--- a/public/stylesheets/css/popup.css
+++ b/public/stylesheets/css/popup.css
@@ -332,4 +332,95 @@ a.contributor_course{float: right; color: #888; font-size: 12px; font-weight: no
.relatePWrap{max-height: 210px;overflow:hidden;}
/*20160622代码分析弹窗*/
-.analysis-option-box {width:100%; border:1px solid #ccc; padding:3px 5px;}
\ No newline at end of file
+.analysis-option-box {width:100%; border:1px solid #ccc; padding:3px 5px;}
+
+/*公共弹框*/
+/* 按钮*/
+
+
+
+
+
+/* 加入班级弹窗 */
+#sy_popup_box{
+ width:460px;
+ background:#fff;
+ padding-bottom:30px;
+ -webkit-border-radius:5px;
+ -moz-border-radius:5px;
+ -o-border-radius:5px;
+ border-radius:5px;
+ box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);
+}
+.sy_popup_top{
+ background:#3b94d6;
+ height:40px;
+ -webkit-border-radius: 5px 5px 0px 0px;
+ -moz-border-radius: 5px 5px 0px 0px;
+ -o-border-radius: 5px 5px 0px 0px;
+ border-radius: 5px 5px 0px 0px;
+}
+.sy_popup_top h3{
+ font-size:18px;
+ color:#fff;
+ font-weight:normal;
+ line-height:40px;
+ padding-left:10px;
+}
+a.sy_icons_close{
+ width:20px;
+ height:20px;
+ display:block;
+ background: url(../images/sy/sy_icons_close.png) 0 0px no-repeat;
+ margin:8px 10px 0 0;
+}
+a:hover.sy_icons_close{
+ background: url(../images/sy/sy_icons_close.png) -40px 0px no-repeat;
+}
+.sy_popup_con{
+ margin:30px auto 0;
+ font-size:14px;
+ width:330px;
+}
+.sy_popup_add label{
+ display:block;
+ float:left;
+ width:85px;
+ text-align:right;
+ line-height:40px;
+}
+.sy_popup_add li{
+ line-height:40px;
+}
+.sy_input_txt{
+ border:1px solid #dedede;
+ height:36px;
+ background:#fff;
+ padding:0 5px;
+ width:220px;
+}
+.sy_popup_con02{
+ margin:30px auto 0;
+ font-size:14px;
+ text-align:center;
+ width:360px;
+}
+.sy_popup_con02 ul li p{
+ margin-bottom:15px;
+ text-align:center;
+ font-size:14px;
+ color:#616161;
+}
+.sy_popup_con02 a{ margin:0 auto;}
+.sy_popup_top_tishi{ background:#ededed; }
+.sy_popup_top_tishi h3{color:#616161; font-size:16px;}
+a.sy_icons_close02{
+ width:20px;
+ height:20px;
+ display:block;
+ background: url(../images/sy/sy_icons_close02.png) 0 0px no-repeat;
+ margin:8px 10px 0 0;
+}
+a:hover.sy_icons_close02{
+ background: url(../images/sy/sy_icons_close02.png) -40px 0px no-repeat;
+}
\ No newline at end of file
diff --git a/public/stylesheets/sy_public.css b/public/stylesheets/sy_public.css
index 7c79bf6e6..77c782698 100644
--- a/public/stylesheets/sy_public.css
+++ b/public/stylesheets/sy_public.css
@@ -62,34 +62,34 @@ a.sy_btn_green{
border-radius:3px;
}
a:hover.sy_btn_green{ background: #51a74f;}
-a.sy_btn_grey{
- color: #333;
- background: #e1e1e1;
- text-align: center;
- font-size: 12px;
- padding:0 15px;
- height: 30px;
- line-height: 30px;
- -webkit-border-radius:3px;
- -moz-border-radius:3px;
- -o-border-radius:3px;
- border-radius:3px;
-}
-a:hover.sy_btn_grey{ background: #c3c3c3;}
-a.sy_btn_blue{
- color: #fff;
- background: #3b94d6;
- text-align: center;
- font-size: 12px;
- padding:0 15px;
- height: 30px;
- line-height: 30px;
- -webkit-border-radius:3px;
- -moz-border-radius:3px;
- -o-border-radius:3px;
- border-radius:3px;
-}
-a:hover.sy_btn_blue{ background: #2788d0;}
+/*a.sy_btn_grey{*/
+ /*color: #333;*/
+ /*background: #e1e1e1;*/
+ /*text-align: center;*/
+ /*font-size: 12px;*/
+ /*padding:0 15px;*/
+ /*height: 30px;*/
+ /*line-height: 30px;*/
+ /*-webkit-border-radius:3px;*/
+ /*-moz-border-radius:3px;*/
+ /*-o-border-radius:3px;*/
+ /*border-radius:3px;*/
+/*}*/
+/*a:hover.sy_btn_grey{ background: #c3c3c3;}*/
+/*a.sy_btn_blue{*/
+ /*color: #fff;*/
+ /*background: #3b94d6;*/
+ /*text-align: center;*/
+ /*font-size: 12px;*/
+ /*padding:0 15px;*/
+ /*height: 30px;*/
+ /*line-height: 30px;*/
+ /*-webkit-border-radius:3px;*/
+ /*-moz-border-radius:3px;*/
+ /*-o-border-radius:3px;*/
+ /*border-radius:3px;*/
+/*}*/
+/*a:hover.sy_btn_blue{ background: #2788d0;}*/
/* 排序 */
.sy_category{
height: 50px;
From e6e8d73a66bba14536987c15d2d8bbe3153c2c84 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Tue, 26 Jul 2016 09:46:55 +0800
Subject: [PATCH 021/108] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8A=A8=E6=80=81?=
=?UTF-8?q?=E8=AF=A6=E6=83=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/javascripts/wechat/others/factory.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/public/javascripts/wechat/others/factory.js b/public/javascripts/wechat/others/factory.js
index 11281c8b8..89e2b700f 100644
--- a/public/javascripts/wechat/others/factory.js
+++ b/public/javascripts/wechat/others/factory.js
@@ -159,6 +159,7 @@ app.factory('common', ['$http', 'auth', '$routeParams','rms','config', function(
return $http({
method: 'POST',
url: apiUrl+ type + "/" + id,
+ dataType: 'jsonp',
data:{token:auth.token(),type:replytype,page:page}
})
};
From 1ae23bafe44ceb73253cea825c338c82f1b93d74 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Tue, 26 Jul 2016 10:12:49 +0800
Subject: [PATCH 022/108] =?UTF-8?q?=E6=94=B9=E5=9B=9E=E5=8E=9F=E6=9D=A5?=
=?UTF-8?q?=E7=9A=84?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb b/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
index 5fd428166..26c78cdd2 100644
--- a/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
+++ b/lib/plugins/acts_as_watchable/lib/acts_as_watchable.rb
@@ -10,7 +10,7 @@ module Redmine
def acts_as_watchable(options = {})
return if self.included_modules.include?(Redmine::Acts::Watchable::InstanceMethods)
class_eval do
- has_many :watchers, :dependent => :delete_all
+ has_many :watchers, :as => :watchable, :dependent => :delete_all
has_many :watcher_users, :through => :watchers, :source => :user, :validate => false
scope :watched_by, lambda { |user_id|
@@ -51,7 +51,7 @@ module Redmine
#通过model层删除以触发before_destroy事件 -by zjc
watchers = Watcher.find_by_sql "select * from `watchers` where watchable_type = 'Principal' AND watchable_id = #{self.id} AND user_id = #{user.id}"
watchers.each do |watcher|
- watcher.destroy
+ watcher.destroy
end
#Watcher.delete_all "watchable_type = 'Principal' AND watchable_id = #{self.id} AND user_id = #{user.id}"
else
From feb45a07bf3a5a690d001b62bf91c958d415d7eb Mon Sep 17 00:00:00 2001
From: cxt
Date: Tue, 26 Jul 2016 16:45:36 +0800
Subject: [PATCH 023/108] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8?=
=?UTF-8?q?=E5=88=86=E4=B8=BA=E6=88=91=E5=88=9B=E5=BB=BA=E7=9A=84=E8=AF=BE?=
=?UTF-8?q?=E7=A8=8B=E5=92=8C=E6=88=91=E5=8A=A0=E5=85=A5=E7=9A=84=E8=AF=BE?=
=?UTF-8?q?=E7=A8=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/users_controller.rb | 78 +++++++---
app/helpers/users_helper.rb | 14 ++
app/views/users/_courses_list.html.erb | 28 ++++
.../users/_syllabus_course_list.html.erb | 61 ++++++++
.../users/_user_join_syllabus_list.html.erb | 3 +
app/views/users/_user_syllabus_list.html.erb | 135 +-----------------
app/views/users/expand_courses.js.erb | 5 +
app/views/users/sort_syllabus_list.js.erb | 5 +
app/views/users/user_courselist.html.erb | 36 ++++-
config/routes.rb | 3 +
public/images/syllabus/icons_syllabus.png | Bin 21845 -> 22951 bytes
11 files changed, 214 insertions(+), 154 deletions(-)
create mode 100644 app/views/users/_courses_list.html.erb
create mode 100644 app/views/users/_syllabus_course_list.html.erb
create mode 100644 app/views/users/_user_join_syllabus_list.html.erb
create mode 100644 app/views/users/expand_courses.js.erb
create mode 100644 app/views/users/sort_syllabus_list.js.erb
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 30f78d9a5..45330b236 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -41,7 +41,7 @@ class UsersController < ApplicationController
:activity_score_index, :influence_score_index, :score_index,:show_new_score, :topic_new_score_index, :project_new_score_index,
:activity_new_score_index, :influence_new_score_index, :score_new_index,:user_projects_index,:user_resource,
:user_courses4show,:user_projects4show,:user_course_activities,:user_project_activities,:user_feedback4show,:user_visitorlist,:user_messages,:edit_brief_introduction,
- :user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist]
+ :user_import_homeworks,:user_search_homeworks,:user_import_resource, :user_system_messages,:choose_user_course,:user_courselist,:user_projectlist,:sort_syllabus_list]
before_filter :auth_user_extension, only: :show
#before_filter :rest_user_score, only: :show
#before_filter :select_entry, only: :user_projects
@@ -3228,7 +3228,35 @@ class UsersController < ApplicationController
end
def user_courselist
- @order, @c_sort,@type = params[:order] || 1, params[:sort] || 1, params[:type] || 1
+ @order, @c_sort, @type, @list_type = 1, 2, 1, 1
+
+ @my_syllabuses = @user.syllabuses
+
+ sy_courses = @user.courses.visible.where("is_delete =? and tea_id != ?", 0, @user.id)
+ syllabus_ids = sy_courses.empty? ? '(-1)' : "(" + sy_courses.map{|course| !course.syllabus_id.nil? && course.syllabus_id}.join(",") + ")"
+ @join_syllabuses = Syllabus.where("id in #{syllabus_ids} and user_id != #{@user.id}")
+
+ @my_syllabuses = syllabus_course_list_sort @my_syllabuses
+ @join_syllabuses = syllabus_course_list_sort @join_syllabuses
+ @my_syllabuses = @my_syllabuses.sort{|x,y| y[:last_update] <=> x[:last_update]}
+ @join_syllabuses = @join_syllabuses.sort{|x,y| y[:last_update] <=> x[:last_update]}
+
+ #分页
+ # @limit = 10
+ # @is_remote = true
+ # @atta_count = @syllabus.count
+ # @atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
+ # @offset ||= @atta_pages.offset
+ # @syllabus = paginateHelper @syllabus,@limit
+
+ respond_to do |format|
+ format.html {render :layout => 'new_base_user'}
+ end
+ end
+
+ #课程列表的排序
+ def sort_syllabus_list
+ @order, @c_sort, @type, @list_type = params[:order] || 1, params[:sort] || 1, params[:type] || 1, params[:list_type] || 1
#确定 sort_type
if @order.to_i == @type.to_i
@@ -3238,40 +3266,48 @@ class UsersController < ApplicationController
end
sort_name = "updated_at"
- sort_type = @c_sort == 1 ? "asc" : "desc"
- @courses = @user.courses.visible.where("is_delete =?", 0)
- syllabus_ids = @courses.empty? ? '(-1)' : "(" + @courses.map{|course| !course.syllabus_id.nil? && course.syllabus_id}.join(",") + ")"
- @syllabus = Syllabus.where("id in #{syllabus_ids} or user_id = #{User.current.id}").order("#{sort_name} #{sort_type}")
+ if @list_type.to_i == 1
+ @syllabuses = @user.syllabuses.order("updated_at desc")
+ else
+ sy_courses = @user.courses.visible.where("is_delete =? and tea_id != ?", 0, @user.id)
+ syllabus_ids = sy_courses.empty? ? '(-1)' : "(" + sy_courses.map{|course| !course.syllabus_id.nil? && course.syllabus_id}.join(",") + ")"
+ @syllabuses = Syllabus.where("id in #{syllabus_ids} and user_id != #{@user.id}").order("updated_at desc")
+ end
- #根据 作业+资源数排序
- if @order.to_i == 2
+ if @order.to_i == 1 #根据 班级更新时间排序
+ @syllabuses = syllabus_course_list_sort @syllabuses
+ @c_sort == 1 ? (@syllabuses = @syllabuses.sort{|x,y| x[:last_update] <=> y[:last_update] }) : (@syllabuses = @syllabuses.sort{|x,y| y[:last_update] <=> x[:last_update]})
+ @type = 1
+ elsif @order.to_i == 2 #根据 作业+资源数排序
@type = 2
- @syllabus.each do |syllabus|
+ @syllabuses.each do |syllabus|
count = 0
- courses = @courses.where("syllabus_id = #{syllabus.id}")
+ courses = syllabus.courses.not_deleted
courses.each do |c|
count += (User.current.admin? || User.current.allowed_to?(:as_teacher,c)) ? (c.homework_commons.count + visable_attachemnts_incourse(c).count) : (c.homework_commons.where("publish_time <= '#{Date.today}'").count + visable_attachemnts_incourse(c).count)
end
syllabus[:infocount] = count
end
- @c_sort == 1 ? (@syllabus = @syllabus.sort{|x,y| x[:infocount] <=> y[:infocount] }) : (@syllabus = @syllabus.sort{|x,y| y[:infocount] <=> x[:infocount]})
- @syllabus = sortby_time_countcommon_nosticky @syllabus,sort_name
+ @c_sort == 1 ? (@syllabuses = @syllabuses.sort{|x,y| x[:infocount] <=> y[:infocount] }) : (@syllabuses = @syllabuses.sort{|x,y| y[:infocount] <=> x[:infocount]})
+ @syllabuses = sortby_time_countcommon_nosticky @syllabuses,sort_name
else
@type = 1
end
- #分页
- @limit = 10
- @is_remote = true
- @atta_count = @syllabus.count
- @atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
- @offset ||= @atta_pages.offset
- @syllabus = paginateHelper @syllabus,@limit
-
respond_to do |format|
format.js
- format.html {render :layout => 'new_base_user'}
+ end
+ end
+
+ #展开课程下的班级
+ def expand_courses
+ @syllabus = Syllabus.where("id = #{params[:syllabus_id]}").first
+ unless @syllabus.nil?
+ @courses = @syllabus.courses.not_deleted.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc")
+ respond_to do |format|
+ format.js
+ end
end
end
diff --git a/app/helpers/users_helper.rb b/app/helpers/users_helper.rb
index 98b993183..6493993b0 100644
--- a/app/helpers/users_helper.rb
+++ b/app/helpers/users_helper.rb
@@ -690,4 +690,18 @@ module UsersHelper
end
result_ids
end
+
+ #课程的班级列表最近更新时间
+ def syllabus_course_list_sort syllabuses
+ syllabuses.each do |sy|
+ updated_at = sy.updated_at
+ courses = sy.courses.not_deleted
+ unless courses.empty?
+ course_ids = "(" + courses.map { |course| course.id}.join(",") + ")"
+ updated_at = CourseActivity.where("course_id in #{course_ids}").order("updated_at desc").first.updated_at
+ end
+ sy[:last_update] = updated_at
+ end
+ syllabuses
+ end
end
diff --git a/app/views/users/_courses_list.html.erb b/app/views/users/_courses_list.html.erb
new file mode 100644
index 000000000..29983bf34
--- /dev/null
+++ b/app/views/users/_courses_list.html.erb
@@ -0,0 +1,28 @@
+<% unless courses.nil? %>
+ <% courses.each_with_index do |course, i| %>
+
+
+
+
+
+
<%=course.name %>
+
主讲老师:<%=course.teacher.show_name %>
+
+
+
+
更新:<%=format_date Time.at(course.updatetime) %> 学期:<%=current_time_and_term(course) %>
+
<%=studentCount course %> 学生 | <%=visable_course_homework course %> 作业 | <%=visable_attachemnts_incourse(@course).count %> 资源
+
+
+
+
+
+
+
+ <% end %>
+ <% if courses.count > 3 %>
+
+ 共<%=courses.count %>个班级,点击全部展开
+
+ <% end %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/_syllabus_course_list.html.erb b/app/views/users/_syllabus_course_list.html.erb
new file mode 100644
index 000000000..06dff2b49
--- /dev/null
+++ b/app/views/users/_syllabus_course_list.html.erb
@@ -0,0 +1,61 @@
+
+ <% if @type.to_i == 2 %>
+ <%= link_to "", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :style => "margin-right: 5px;", :remote => true %>
+ <% else %>
+ <%= link_to "", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortdownbtn sort_no fr", :style => "margin-right: 5px;", :remote => true %>
+ <% end %>
+ <%= link_to "人气", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortTxt fr", :remote => true %>
+ <% if @type.to_i == 1 %>
+ <%= link_to "", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fr", :remote => true %>
+ <% else %>
+ <%= link_to "", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortdownbtn sort_no fr", :remote => true %>
+ <% end %>
+ <%= link_to "时间", {:controller => 'users', :action => 'sort_syllabus_list', :id =>@user,:list_type => list_type, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt fr", :remote => true %>
+
我<%= list_type == 1 ? "创建" : "加入"%>的课程
+
+
+
+<% if syllabuses.any? %>
+ <% syllabuses.each_with_index do |syllabus, index|%>
+
+ <% course_count = syllabus.courses.not_deleted.count %>
+
+
+
+
<%=syllabus.title %>
+
+
更新时间:<%=format_date syllabus.updated_at %>
+ 创建老师:<%=syllabus.user.show_name %>
+ 班级:<%=course_count %>
+
+
+
+
+
+
+ <% if index == 0 %>
+ <% courses = syllabus.courses.not_deleted.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc") %>
+ <%= render :partial => 'users/courses_list', :locals => {:courses => courses, :syllabus => syllabus}%>
+ <% end %>
+
+
+
+
+
+
+
+
+ <%=link_to '查看课程', syllabus_path(syllabus.id), :class => 'postOptionLink',:target =>'_blank', :title => '查看课程' %>
+
+ <% if User.current == syllabus.user %>
+ <%=link_to '删除课程', delete_syllabus_syllabus_path(syllabus), :class => 'postOptionLink', :remote => 'true'%>
+ <% end %>
+
+
+
+
+
+ <% end %>
+<% else %>
+ <%= l(:label_no_data) %>
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/_user_join_syllabus_list.html.erb b/app/views/users/_user_join_syllabus_list.html.erb
new file mode 100644
index 000000000..7faab0017
--- /dev/null
+++ b/app/views/users/_user_join_syllabus_list.html.erb
@@ -0,0 +1,3 @@
+
+ <%= render :partial => "users/syllabus_course_list", :locals => {:syllabuses => @join_syllabuses, :list_type => 2} %>
+
diff --git a/app/views/users/_user_syllabus_list.html.erb b/app/views/users/_user_syllabus_list.html.erb
index 9fa93c76e..b6c767771 100644
--- a/app/views/users/_user_syllabus_list.html.erb
+++ b/app/views/users/_user_syllabus_list.html.erb
@@ -1,132 +1,3 @@
-
-
课程列表
-
-
排序:
- <%= link_to "时间", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortTxt fl", :remote => true %>
- <% if @type.to_i == 1 %>
- <%= link_to "", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fl", :remote => true %>
- <% else %>
- <%= link_to "", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 1 }, :class => "sortdownbtn sort_no fl", :remote => true %>
- <% end %>
- <%= link_to "人气", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortTxt fl", :remote => true %>
- <% if @type.to_i == 2 %>
- <%= link_to "", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 2 }, :class => "#{@c_sort.to_i == 1 ? 'sortupbtn' : 'sortdownbtn'} fl", :remote => true %>
- <% else %>
- <%= link_to "", {:controller => 'users', :action => 'user_courselist', :id =>@user, :type => @type, :sort => @c_sort, :order => 2 }, :class => "sortdownbtn sort_no fl", :remote => true %>
- <% end %>
-
-
-
- <% if @syllabus.any? %>
- <% @syllabus.each_with_index do |syllabus, index|%>
-
- <% courses = @courses.where("syllabus_id = #{syllabus.id}").select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("time desc") %>
-
-
-
-
<%=syllabus.title %>
-
-
更新时间:<%=format_date syllabus.updated_at %>
- 创建老师:<%=syllabus.user.show_name %>
- 班级:<%=courses.count %>
-
-
-
-
-
-
-
-
-
-
-
- <%=link_to '查看课程', syllabus_path(syllabus.id), :class => 'postOptionLink',:target =>'_blank', :title => '查看课程' %>
-
- <% if User.current == syllabus.user %>
- <%=link_to '删除课程', delete_syllabus_syllabus_path(syllabus), :class => 'postOptionLink', :remote => 'true'%>
- <% end %>
-
-
-
-
-
- <% end %>
-
-
- <%= pagination_links_full @atta_pages, @atta_count, :per_page_links => false, :remote => @is_remote, :flag => true %>
-
-
-
- <% else %>
-
<%= l(:label_no_data) %>
- <% end %>
-
-
-
\ No newline at end of file
+
+ <%= render :partial => "users/syllabus_course_list", :locals => {:syllabuses => @my_syllabuses, :list_type => 1} %>
+
\ No newline at end of file
diff --git a/app/views/users/expand_courses.js.erb b/app/views/users/expand_courses.js.erb
new file mode 100644
index 000000000..3b2291e1d
--- /dev/null
+++ b/app/views/users/expand_courses.js.erb
@@ -0,0 +1,5 @@
+<% unless @courses.empty? %>
+ $("#syllabus_course_ul_<%=@syllabus.id %>").html("<%=escape_javascript(render :partial => 'users/courses_list', :locals => {:courses => @courses, :syllabus => @syllabus}) %>");
+ $("#syllabus_course_ul_<%=@syllabus.id %>").parent().show();
+ $("#syllabus_course_ul_<%=@syllabus.id %>").parent().prev().children(":first-child").children(":first-child").toggleClass("icons_sy_close").toggleClass("icons_sy_open");
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/sort_syllabus_list.js.erb b/app/views/users/sort_syllabus_list.js.erb
new file mode 100644
index 000000000..e353109f4
--- /dev/null
+++ b/app/views/users/sort_syllabus_list.js.erb
@@ -0,0 +1,5 @@
+<% if @list_type.to_i == 1 %>
+$("#user_syllabus_list").html('<%= escape_javascript(render :partial => "users/syllabus_course_list", :locals => {:syllabuses => @syllabuses, :list_type => 1}) %>');
+<% else %>
+$("#user_join_syllabus_list").html('<%= escape_javascript(render :partial => "users/syllabus_course_list", :locals => {:syllabuses => @syllabuses, :list_type => 2}) %>');
+<% end %>
\ No newline at end of file
diff --git a/app/views/users/user_courselist.html.erb b/app/views/users/user_courselist.html.erb
index 148cc1703..25bf2354d 100644
--- a/app/views/users/user_courselist.html.erb
+++ b/app/views/users/user_courselist.html.erb
@@ -1 +1,35 @@
-<%= render :partial => 'users/user_syllabus_list'%>
+
+
课程列表
+
+ <%= render :partial => 'users/user_syllabus_list'%>
+
+ <%= render :partial => 'users/user_join_syllabus_list'%>
+
+
+
+
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index 5439da9f4..6c16dbd7d 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -563,6 +563,7 @@ RedmineApp::Application.routes.draw do
post "user_commit_homework"
post 'user_select_homework'
get 'all_journals'
+ get 'expand_courses'
end
member do
@@ -619,6 +620,8 @@ RedmineApp::Application.routes.draw do
match 'user_courselist', :to => 'users#user_courselist', :via => :get, :as => "user_courselist"
match 'user_projectlist', :to => 'users#user_projectlist', :via => :get, :as => "user_projectlist"
+ match 'sort_syllabus_list', :to => 'users#sort_syllabus_list', :via => :get, :as => "sort_syllabus_list"
+
get 'edit_brief_introduction'
get "user_resource"
get "import_resources"
diff --git a/public/images/syllabus/icons_syllabus.png b/public/images/syllabus/icons_syllabus.png
index 7f6c4987cc280922e84f6cc32ed3750b0af87e52..4afdb729f96ffa021e9e40a271718a7ea3883b63 100644
GIT binary patch
delta 2548
zcmbW1dpMN&0>@`C4Pql~CDu@p+PB`@yze^*b1{wkX|aTjxf<=(xGaaTGdf*Z(qw9N
zL@p_tA`z>LODVCV?26E;BbQ{^C6|Owd#2j+&pyxYbDs12>v#EnKi}`~dEe*PT}Cdg
zCRZNQ*V;Z=t@GsYIMaR-Tz6cda{c6LrBL;b@i{S=d~R8BAGz!Ad(3qMGjF?*_X0d
zsVvF?gvCOPE))T}Ko|(XzzHE86Nz931N#d*#wQR6!bJb49hZnu6ekb>#s%Wv(;-3#
z5SS3g7<3%s!-OW?o(3WW2thas;xLF25Ja#c)Qv+R3z6J&}XZ>&z-~cPk1zumz3roU~$)Fd>!8F5&PK-GuBDR6IG9j
z&s7(l7~%400%Os!OSvW4Hb(nt6Gz`f6`2QbHn!$b*40LBXfC(#+|wKwpQOjS#&b5Q
z_S&;J^rmH7?EL-q`q;_#`*HHHy7v6*qy3ZZ3;i>%@?+!6I>*qm?{~O-C(pQ?H8K`-
zcebGBybp-^o-%U-^w00aUB;Q}|5LZm+oOLx#
z^GN0R1(y2g1FVtp{^fw26*;<#W7rlraF83kpdZTDkyiEVKN+v=DIYN7>ZYXWHTfD0
z>J)-nFReFOiqF3V+8a@dKcV$hEDQZSOq#Siu<-SKOKGIxj({M;bh~m%c=?SKhZAWv
zIjx)2ROuxijain+3rGgQTZGll;>nOL1=5Gggido^C$Z^Dc~e?KXRy{q&kcecR#nU#
z`5V%>!t;dgdP+&E?a;q7wHExi`x@{0nG+PRDEHcB30qEIIiwZfh6zunC@whHKh9)0
z#x){W0?4^Xj(x&w)S6M88a`>)W6R4m=3Wm=ciwQpI(oD@)W+9ju%qdUzfJtZx|h*T
zk$b4|s9qgBlL(zU(s9ITk6SYSFK5?~v)#&=S?l`f
zjwiGB=DhwNWw%GzqmIe*$cvJ>%C0SnrI9$}C=0@No!nAE&2);*c(u17MRB#>umm4e
z&MTNP4VzA1sV!Z38IWWe`3Cu!;<%9<5^VFc$6R{6g#hzy>1s3IUUk;m
zEC1v@x!lyr+tpSHorjF>eM7f5@QpxK-m
z`|;JFo2f+}so%c)6O_82D|94#<);kWskYi@E|n?87bZ3#ncP87c(9|rX
zoE)0|&LMo|)cThbWBT@W0{<-qJbdRoNgg(`vE(Dj^arw2(1A;*d{<3XSR7_gr=!ZB
zDp$Q3Pad|ix%WNCDlujusHr+;Lhq(sr|TklGTfKF)O}>yf5p`E9Cc}9v@=-fJDl2{
zeZMBioBGkTvLe*^7GcYa?#J2%<6XYFV=ImO21`)i)Nj*=T&7uHYEM?)Q!Pf+A7
zZBcPm)W*yXvjK~~%~?HbMsa2Rc>wVKRDM*$fIW8M+8s+b?w)E=QwE++Es&+Hs=epb
zHIJK2HRrObvP`=lFTEbN&+#4poVV(48TC2#GcG27S4$)6JR8nTFP6V3`EBgx)}dJH
z)OGDH8TX!4b*}9I*ne2lcR~fp-;~Fgc1jcTWucDGt;1R(3ZqwKzENMidM2iSXrRVm
z{R2^o>8*O_S*2}32W9B>q(W1w%J7v#Q%VEXdG7s1V<<~5>G#c|k1lUQni@aqd^U6S
zi@Y%X=O&4?f7T|ZcKFO})$3}QIcAsRyR9-ftHnt3Rdm8Hc*znX<)6lr=g9@8Psg7j
z<_SBpqOBJ=@yErxFPT0JP0U{V{Ir1+zo)g|59zL%Kdp71x%O}mn
zbyJYr*B*TNjZw?TRp05&F=&pY4^h)6ulJVp8FxmkJ_GL4iX>;-|B7J%}B3{d0#`q&!8Z#`-?~NT&uI%jrA3|6hk%wDz8Ma77c*j
zrF5&Yaj?DVhs=jAwE2pgXS9Ty%c@A^x-|*R!A$#@Jx6EP0M-u;PHd-@ZMiBjz9
dUtjtgm6Y~)ONCkAnrxD0xV!mqDp=wB{{wkeF=qe(
delta 1877
zcma)5XHb)g7X4D_U0_2~`Ua6K5CRg!5K0h~8iIg46{HE$T&WUBA}v6Czy@*Y0#X7Y
zs35Q+CJsdbsUa(6DK0t-p_fpE^*wgp{@P#f&fFjO&Y648oqKLw3y9YMdX_H^wi9Zh
zi}ymL%n(Qv!PwLSdENqPL=Tci|D)3=9i(G~@()4=BmEIU#^$#WC^QO*K%@PUh+vZd
zv%rABTLD4-CM_tL4AK7!NuPt6|AS=Y)L_fH(mt3zqAp5rIpavjsXNj?o@A(oW6P07
zjxjXUG#XFO#v79EI@(zi5~f#6BdCg=O7BQ_GE@x$n|@&a;=gNMhb;6amiUb7-MgYY
zEwjgPCZ?AZ$U$us(o(`JmAuc%SIQ{sJ?~|CuU@@y=R273U@g_b!D~xb3Tncb$wW7X
zglx+hqQysJpY9Zi0ckvX`Ay1KeiE?2vN
z3$99~isM8y-S7Zj66>wk3y2m#v6mHzvITe{L$@l%@I2#4V*dJ;%k|RlCHz)?ZHmSB
zoQ>gYfwWF(fbA6OJYbGea$>UoD+?af9?9#(XqnpSV4+k8a-hd~Tex+OTaCs36P(^M
z>9>H1JiO2u)VRLq0$AIc?#W!}mQKo1e9dvFlo0(@P`+)XPUXp!&otGuK8ga686=6K$`kDYiDNtWrX)M}zk&|+sd+lE!DXB>{t_Wn!m~WM
zX|~zE;ssB3@IT1M{T`VI63=@2mAzV9Qw!ImflHJ_F;4CdsP6y>B^?B&Om>QOu!iH!
z(TmwZou>=e{#{>f3!1Ln{+CFbj=f-DysQ{Va&69oAku*H2Xz`t`N*uq1IwOv^^
z4~k)3Q|8R;T-C)++#cwDV^ap9N~VaGPv|QW5I^~
zf?Blw!x-Rd*hl6=($=ij5pV~t`abZ3?VM0>{Z845M00etYlXIV+XeYa24>i;n>(k2
zX@G3(4B^H%`}Zt+>V!D%gK_adMPutb%Ju2@a4CdaHRH#lr#Ec%$1=kSr}?Dmv^8u#
z(W+j|*LtYFkq4jIk?l$xw}E#iPqjUjwHPa@`w7ESuplwABd{kc-%gJo?pGeVyP+tn
zcY1Mg#TD?8sq9&T4`QZRnxXnD=Q3X0d!7x?_}gSUSR`{<-f3bTD1?jvS17-5tiq1V
zMKB=Y($c$#ti#RCXgzfSYw2Zvx8l*g1W!ckB>uAE}X}lA?X0RRmQZnk3=mIJ_
zZQH=jdC7w-LC`8<csH1V~%SVGQoE7yE)*2-KCY%Cc!
z^ge39h*sRJNopj^Cp5+kQiNj-yh7oGa+E-LQ*DmqTaGXdG@zxBKY4gfk&aKTAF{j7
zzhsn$_^SGtHCN)kECbRtyOPb|9C9Yv+Ap15JMoi!2;YP^Grv984x4<;_D0?FnlUg#
zlwVYtPEhJ7wV|gsD5r8#IsNW>FMkW{l5AB&$HtOulz^jcm@+0-@%7K#J%x(J2M?n0
z*2>W0u*3qM^yb*s6$)&X{iyEZmyj*n#LhxWE9jW{m4+YRZhiDAF&Gf=i75z(SQD}@
z;}7sn@IHj?F2w#|QiR}l$(+3b|
z0rO6TS~_JQ30)JiBzyx}&Wcs~+T&Ky#2z_t9;>!!@>8=R$Y}ua5JN^{pVp(jGQP#gZ~0Pk5q~P
From e3057566c82e8e5de107c46a5c1738fc72ceda5e Mon Sep 17 00:00:00 2001
From: Tim
Date: Tue, 26 Jul 2016 17:30:02 +0800
Subject: [PATCH 024/108] =?UTF-8?q?=E5=90=84=E8=AF=A6=E6=83=85=E9=A1=B5?=
=?UTF-8?q?=E9=9D=A2=E5=86=85=E5=AE=B9=E5=92=8C=E4=BA=8C=E7=BA=A7=E5=9B=9E?=
=?UTF-8?q?=E5=A4=8D=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4=EF=BC=9B=E5=9B=9E?=
=?UTF-8?q?=E5=A4=8D=E8=AF=A6=E6=83=85=E5=86=85=E5=AE=B9=E4=B8=8D=E6=98=BE?=
=?UTF-8?q?=E7=A4=BAbug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/assets/wechat/blog_detail.html | 39 ++--
public/assets/wechat/course_discussion.html | 47 +++--
public/assets/wechat/course_notice.html | 38 ++--
public/assets/wechat/homework_detail.html | 173 +++++++++---------
public/assets/wechat/issue_detail.html | 46 ++---
public/assets/wechat/jour_message_detail.html | 49 +++--
public/assets/wechat/project_discussion.html | 51 +++---
.../wechat/templates/comment_reply.html | 38 ++--
public/stylesheets/weui/weixin.css | 12 +-
9 files changed, 240 insertions(+), 253 deletions(-)
diff --git a/public/assets/wechat/blog_detail.html b/public/assets/wechat/blog_detail.html
index 721c3d38e..ee9e968d2 100644
--- a/public/assets/wechat/blog_detail.html
+++ b/public/assets/wechat/blog_detail.html
@@ -13,11 +13,13 @@