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
def change
def up
execute("UPDATE taggings SET taggable_type='CommitStatus' WHERE taggable_type='Ci::Build'")
end
def down
execute("UPDATE taggings SET taggable_type='Ci::Build' WHERE taggable_type='CommitStatus'")
end
end
class FailBuildWithoutNames < ActiveRecord::Migration
def change
def up
execute("UPDATE ci_builds SET status='failed' WHERE name IS NULL AND status='pending'")
end
def down
end
end
class FailBuildWithEmptyName < ActiveRecord::Migration
def change
def up
execute("UPDATE ci_builds SET status='failed' WHERE (name IS NULL OR name='') AND status='pending'")
end
def down
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