summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20151019111551_fix_build_tags.rb6
-rw-r--r--db/migrate/20151019111703_fail_build_without_names.rb5
-rw-r--r--db/migrate/20151023112551_fail_build_with_empty_name.rb5
3 files changed, 13 insertions, 3 deletions
diff --git a/db/migrate/20151019111551_fix_build_tags.rb b/db/migrate/20151019111551_fix_build_tags.rb
index 84b142183f8..299a24b0a7c 100644
--- a/db/migrate/20151019111551_fix_build_tags.rb
+++ b/db/migrate/20151019111551_fix_build_tags.rb
@@ -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
diff --git a/db/migrate/20151019111703_fail_build_without_names.rb b/db/migrate/20151019111703_fail_build_without_names.rb
index 546b03d8129..dcdb5d1b25d 100644
--- a/db/migrate/20151019111703_fail_build_without_names.rb
+++ b/db/migrate/20151019111703_fail_build_without_names.rb
@@ -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
diff --git a/db/migrate/20151023112551_fail_build_with_empty_name.rb b/db/migrate/20151023112551_fail_build_with_empty_name.rb
index f069bc60ac7..41c0f0649cd 100644
--- a/db/migrate/20151023112551_fail_build_with_empty_name.rb
+++ b/db/migrate/20151023112551_fail_build_with_empty_name.rb
@@ -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