删除 由于course、project一张表而引起的历史数据异常问题
This commit is contained in:
parent
074d8f62c2
commit
721a007779
|
@ -0,0 +1,15 @@
|
|||
class DeleteValidProject < ActiveRecord::Migration
|
||||
def up
|
||||
projects = Project.where("project_type =?", 1)
|
||||
begin
|
||||
projects.each do |p|
|
||||
p.delete
|
||||
end
|
||||
rescue => e
|
||||
logger.error "Delete project failed ====>#{e}"
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20151215070238) do
|
||||
ActiveRecord::Schema.define(:version => 20151217051447) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
|
Loading…
Reference in New Issue