迁移原课程资源文件类型数据

This commit is contained in:
nwb 2014-06-18 16:11:38 +08:00
parent 462e5ab589
commit 2a9d6eb012
2 changed files with 13 additions and 1 deletions

View File

@ -0,0 +1,12 @@
class MigrateCourseFileType < ActiveRecord::Migration
def change
# 迁移原课程资源文件类型
Attachment.all.each do |attach|
if attach.container_type == "Course" && attach.attachtype == 1
attach.attachtype = 4
attach.save
end
end
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20140618105214) do
ActiveRecord::Schema.define(:version => 20140618155324) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false