Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
parent
9c4c1679af
commit
12cf56d201
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue