Commit 1423284c authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'reversible_migration' into 'master'

Make migrations reversible



See merge request !1753
parents ccf5e2d6 aecc4376
class FixBuildTags < ActiveRecord::Migration class FixBuildTags < ActiveRecord::Migration
def change def up
execute("UPDATE taggings SET taggable_type='CommitStatus' WHERE taggable_type='Ci::Build'") execute("UPDATE taggings SET taggable_type='CommitStatus' WHERE taggable_type='Ci::Build'")
end end
def down
execute("UPDATE taggings SET taggable_type='Ci::Build' WHERE taggable_type='CommitStatus'")
end
end end
class FailBuildWithoutNames < ActiveRecord::Migration class FailBuildWithoutNames < ActiveRecord::Migration
def change def up
execute("UPDATE ci_builds SET status='failed' WHERE name IS NULL AND status='pending'") execute("UPDATE ci_builds SET status='failed' WHERE name IS NULL AND status='pending'")
end end
def down
end
end end
class FailBuildWithEmptyName < ActiveRecord::Migration class FailBuildWithEmptyName < ActiveRecord::Migration
def change def up
execute("UPDATE ci_builds SET status='failed' WHERE (name IS NULL OR name='') AND status='pending'") execute("UPDATE ci_builds SET status='failed' WHERE (name IS NULL OR name='') AND status='pending'")
end end
def down
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment