diff --git a/db/migrate/20140618155324_migrate_course_file_type.rb b/db/migrate/20140618155324_migrate_course_file_type.rb new file mode 100644 index 000000000..6cbf3b878 --- /dev/null +++ b/db/migrate/20140618155324_migrate_course_file_type.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 18a3fb841..8c6ed01fe 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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