diff --git a/db/migrate/20141030071656_add_data_for_school.rb b/db/migrate/20141030071656_add_data_for_school.rb index 71b600b16..94db0ea19 100644 --- a/db/migrate/20141030071656_add_data_for_school.rb +++ b/db/migrate/20141030071656_add_data_for_school.rb @@ -1,26 +1,26 @@ -#encoding=UTF-8 -class AddDataForSchool < ActiveRecord::Migration - def up - sql = " Insert into schools (name, province, logo_link) values - ('香港大学','香港','/images/transparent.png'), - ('香港大学','香港','/images/transparent.png'), - ('香港中文大学','香港','/images/transparent.png'), - ('香港科技大学','香港','/images/transparent.png'),('香港理工大学','香港','/images/transparent.png'), - ('香港城市大学','香港','/images/transparent.png'),('香港浸会大学','香港','/images/transparent.png'), - ('香港教育学院','香港','/images/transparent.png'),('香港歌德学院','香港','/images/transparent.png'), - ('香港岭南大学','香港','/images/transparent.png'),('澳门大学','澳门','/images/transparent.png'), - ('澳门理工学院','澳门','/images/transparent.png'),('澳门科技大学','澳门','/images/transparent.png'), - ('澳门保安部队高等学校','澳门','/images/transparent.png'),('亚洲国际公开大学','澳门','/images/transparent.png'), - ('澳门旅游学院','澳门','/images/transparent.png'),('清华大学(新竹)','台湾','/images/transparent.png'), - ('台湾大学','台湾','/images/transparent.png'),('交通大学','台湾','/images/transparent.png'), - ('中央大学','台湾','/images/transparent.png'),('成功大学','台湾','/images/transparent.png'), - ('中山大学','台湾','/images/transparent.png'),('中原大学','台湾','/images/transparent.png'), - ('政治大学','台湾','/images/transparent.png'),('元智大学','台湾','/images/transparent.png'), - ('天主教辅仁大学','台湾','/images/transparent.png'),('台湾科技大学','台湾','/images/transparent.png'), - ('台湾师范大学','台湾','/images/transparent.png'),('台湾艺术大学','台湾','/images/transparent.png')" - execute(sql) - end - - def down - end -end +#encoding=UTF-8 +class AddDataForSchool < ActiveRecord::Migration + def up + sql = " Insert into schools (name, province, logo_link) values + ('香港大学','香港','/images/transparent.png'), + ('香港大学','香港','/images/transparent.png'), + ('香港中文大学','香港','/images/transparent.png'), + ('香港科技大学','香港','/images/transparent.png'),('香港理工大学','香港','/images/transparent.png'), + ('香港城市大学','香港','/images/transparent.png'),('香港浸会大学','香港','/images/transparent.png'), + ('香港教育学院','香港','/images/transparent.png'),('香港歌德学院','香港','/images/transparent.png'), + ('香港岭南大学','香港','/images/transparent.png'),('澳门大学','澳门','/images/transparent.png'), + ('澳门理工学院','澳门','/images/transparent.png'),('澳门科技大学','澳门','/images/transparent.png'), + ('澳门保安部队高等学校','澳门','/images/transparent.png'),('亚洲国际公开大学','澳门','/images/transparent.png'), + ('澳门旅游学院','澳门','/images/transparent.png'),('清华大学(新竹)','台湾','/images/transparent.png'), + ('台湾大学','台湾','/images/transparent.png'),('交通大学','台湾','/images/transparent.png'), + ('中央大学','台湾','/images/transparent.png'),('成功大学','台湾','/images/transparent.png'), + ('中山大学','台湾','/images/transparent.png'),('中原大学','台湾','/images/transparent.png'), + ('政治大学','台湾','/images/transparent.png'),('元智大学','台湾','/images/transparent.png'), + ('天主教辅仁大学','台湾','/images/transparent.png'),('台湾科技大学','台湾','/images/transparent.png'), + ('台湾师范大学','台湾','/images/transparent.png'),('台湾艺术大学','台湾','/images/transparent.png')" + execute(sql) + end + + def down + end +end diff --git a/db/migrate/20141031065238_change_data_for_courses.rb b/db/migrate/20141031065238_change_data_for_courses.rb index f3ee0ab54..d23e0343e 100644 --- a/db/migrate/20141031065238_change_data_for_courses.rb +++ b/db/migrate/20141031065238_change_data_for_courses.rb @@ -1,10 +1,10 @@ -#encoding=UTF-8 -class ChangeDataForCourses < ActiveRecord::Migration - def up - sql = "UPDATE courses set school_id = 117 where id =58" - execute(sql) - end - - def down - end -end +#encoding=UTF-8 +class ChangeDataForCourses < ActiveRecord::Migration + def up + sql = "UPDATE courses set school_id = 117 where id =58" + execute(sql) + end + + def down + end +end diff --git a/db/migrate/20141031122331_change_school_id_for_school.rb b/db/migrate/20141031122331_change_school_id_for_school.rb index e042bd48e..e779b1a5b 100644 --- a/db/migrate/20141031122331_change_school_id_for_school.rb +++ b/db/migrate/20141031122331_change_school_id_for_school.rb @@ -1,11 +1,11 @@ -#encoding=UTF-8 -class ChangeSchoolIdForSchool < ActiveRecord::Migration - def up - sql = "update courses, user_extensions set courses.school_id = user_extensions.school_id - where courses.tea_id = user_extensions.user_id" - execute(sql) - end - - def down - end -end +#encoding=UTF-8 +class ChangeSchoolIdForSchool < ActiveRecord::Migration + def up + sql = "update courses, user_extensions set courses.school_id = user_extensions.school_id + where courses.tea_id = user_extensions.user_id" + execute(sql) + end + + def down + end +end