Merge branch 'reversible_migration' into 'master'

Make migrations reversible



See merge request !1753
This commit is contained in:
Dmitriy Zaporozhets 2015-11-05 15:58:20 +00:00
commit 1423284c74
3 changed files with 13 additions and 3 deletions

View file

@ -1,5 +1,9 @@
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

View file

@ -1,5 +1,8 @@
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

View file

@ -1,5 +1,8 @@
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