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

CourseModify
nwb 11 years ago
parent 462e5ab589
commit 2a9d6eb012

@ -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

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # 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| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false

Loading…
Cancel
Save