Merge branch 'develop' into szzh
This commit is contained in:
commit
545b07a34c
|
@ -1,9 +1,9 @@
|
|||
class UpdateActivitiesData < ActiveRecord::Migration
|
||||
def up
|
||||
count = Activity.all.count / 10 + 1
|
||||
count = Activity.all.count / 20 + 1
|
||||
transaction do
|
||||
for i in 1 ... count do i
|
||||
Activity.all.each do |activity|
|
||||
Activity.page(i).per(20).each do |activity|
|
||||
type = activity.act_type
|
||||
if type=='Contest' || type=='Message' || type=='News'|| type=='Journal'|| type=='Issue'|| type=='Principal'||type=='JournalsForMessage'
|
||||
activity.created_at = activity.act.created_on if activity.act
|
||||
|
|
40
db/schema.rb
40
db/schema.rb
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20150810064247) do
|
||||
ActiveRecord::Schema.define(:version => 20150815030833) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -325,6 +325,15 @@ ActiveRecord::Schema.define(:version => 20150810064247) do
|
|||
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
|
||||
|
||||
create_table "course_attachments", :force => true do |t|
|
||||
t.string "filename"
|
||||
t.string "disk_filename"
|
||||
|
@ -357,6 +366,16 @@ ActiveRecord::Schema.define(:version => 20150810064247) do
|
|||
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
|
||||
end
|
||||
|
||||
create_table "course_statuses", :force => true do |t|
|
||||
t.integer "changesets_count"
|
||||
t.integer "watchers_count"
|
||||
|
@ -455,6 +474,13 @@ ActiveRecord::Schema.define(:version => 20150810064247) do
|
|||
|
||||
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
|
||||
|
@ -536,6 +562,16 @@ ActiveRecord::Schema.define(:version => 20150810064247) do
|
|||
|
||||
add_index "forge_activities", ["forge_act_id"], :name => "index_forge_activities_on_forge_act_id"
|
||||
|
||||
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
|
||||
end
|
||||
|
||||
create_table "forums", :force => true do |t|
|
||||
t.string "name", :null => false
|
||||
t.text "description"
|
||||
|
@ -857,7 +893,6 @@ ActiveRecord::Schema.define(:version => 20150810064247) do
|
|||
t.datetime "created_on"
|
||||
t.integer "comments_count", :default => 0, :null => false
|
||||
t.integer "course_id"
|
||||
t.datetime "updated_on"
|
||||
end
|
||||
|
||||
add_index "news", ["author_id"], :name => "index_news_on_author_id"
|
||||
|
@ -1262,6 +1297,7 @@ ActiveRecord::Schema.define(:version => 20150810064247) do
|
|||
t.datetime "updated_at", :null => false
|
||||
t.integer "late_penalty", :default => 0
|
||||
t.integer "absence_penalty", :default => 0
|
||||
t.integer "system_score"
|
||||
end
|
||||
|
||||
create_table "student_works_evaluation_distributions", :force => true do |t|
|
||||
|
|
Loading…
Reference in New Issue