make migrations reversible
This commit is contained in:
parent
4f574388fc
commit
aecc4376e2
3 changed files with 13 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue