diff --git a/db/migrate/20151019111551_fix_build_tags.rb b/db/migrate/20151019111551_fix_build_tags.rb
new file mode 100644
index 0000000000000000000000000000000000000000..84b142183f8a7c60a14c3c8c6a15315750299cf0
--- /dev/null
+++ b/db/migrate/20151019111551_fix_build_tags.rb
@@ -0,0 +1,5 @@
+class FixBuildTags < ActiveRecord::Migration
+  def change
+    execute("UPDATE taggings SET taggable_type='CommitStatus' WHERE taggable_type='Ci::Build'")
+  end
+end
diff --git a/db/migrate/20151019111703_fail_build_without_names.rb b/db/migrate/20151019111703_fail_build_without_names.rb
new file mode 100644
index 0000000000000000000000000000000000000000..546b03d81295d0c0fba62eaf67615d14dcd3d8a5
--- /dev/null
+++ b/db/migrate/20151019111703_fail_build_without_names.rb
@@ -0,0 +1,5 @@
+class FailBuildWithoutNames < ActiveRecord::Migration
+  def change
+    execute("UPDATE ci_builds SET status='failed' WHERE name IS NULL AND status='pending'")
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index b05fa708775bab9a5fcbde215688f08a5d1fe378..93afea35eb5f30d590efb54da69197d8502bc68f 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema.define(version: 20151016195706) do
+ActiveRecord::Schema.define(version: 20151019111703) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"