Commit aecc4376 authored by Valery Sizov's avatar Valery Sizov

make migrations reversible

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