Commit aecc4376 authored by Valery Sizov's avatar Valery Sizov

make migrations reversible

parent 4f574388
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