From f3650d2e5da4dc3624bcf4940825fe24266a91b4 Mon Sep 17 00:00:00 2001
From: Douwe Maan <douwe@gitlab.com>
Date: Tue, 24 Mar 2015 17:00:56 +0100
Subject: [PATCH] Add migration.

---
 .../20150324155957_set_incorrect_assignee_id_to_null.rb     | 6 ++++++
 db/schema.rb                                                | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 db/migrate/20150324155957_set_incorrect_assignee_id_to_null.rb

diff --git a/db/migrate/20150324155957_set_incorrect_assignee_id_to_null.rb b/db/migrate/20150324155957_set_incorrect_assignee_id_to_null.rb
new file mode 100644
index 00000000000..42dc8173e46
--- /dev/null
+++ b/db/migrate/20150324155957_set_incorrect_assignee_id_to_null.rb
@@ -0,0 +1,6 @@
+class SetIncorrectAssigneeIdToNull < ActiveRecord::Migration
+  def up
+    execute "UPDATE issues SET assignee_id = NULL WHERE assignee_id = -1"
+    execute "UPDATE merge_requests SET assignee_id = NULL WHERE assignee_id = -1"
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index e1a5b70532a..4a445ae5832 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: 20150320234437) do
+ActiveRecord::Schema.define(version: 20150324155957) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
-- 
GitLab