summaryrefslogtreecommitdiff
path: root/db/migrate/20151023112551_fail_build_with_empty_name.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20151023112551_fail_build_with_empty_name.rb')
-rw-r--r--db/migrate/20151023112551_fail_build_with_empty_name.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/db/migrate/20151023112551_fail_build_with_empty_name.rb b/db/migrate/20151023112551_fail_build_with_empty_name.rb
new file mode 100644
index 00000000000..41c0f0649cd
--- /dev/null
+++ b/db/migrate/20151023112551_fail_build_with_empty_name.rb
@@ -0,0 +1,8 @@
+class FailBuildWithEmptyName < ActiveRecord::Migration
+ def up
+ execute("UPDATE ci_builds SET status='failed' WHERE (name IS NULL OR name='') AND status='pending'")
+ end
+
+ def down
+ end
+end