Merge branch 'reversible_migration' into 'master'
Make migrations reversible See merge request !1753
This commit is contained in:
commit
1423284c74
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