From cc3b6f12cca88d25490ef7075b69cc9fad0f04d4 Mon Sep 17 00:00:00 2001
From: Stan Hu <stanhu@gmail.com>
Date: Tue, 30 Aug 2016 16:29:11 -0700
Subject: [PATCH] Remove not-null constraint on lock_version column if it
 exists

Closes #21678
---
 .../20160830232601_change_lock_version_not_null.rb  | 13 +++++++++++++
 db/schema.rb                                        |  2 +-
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 db/migrate/20160830232601_change_lock_version_not_null.rb

diff --git a/db/migrate/20160830232601_change_lock_version_not_null.rb b/db/migrate/20160830232601_change_lock_version_not_null.rb
new file mode 100644
index 00000000000..01c58ed5bdc
--- /dev/null
+++ b/db/migrate/20160830232601_change_lock_version_not_null.rb
@@ -0,0 +1,13 @@
+class ChangeLockVersionNotNull < ActiveRecord::Migration
+  include Gitlab::Database::MigrationHelpers
+
+  DOWNTIME = false
+
+  def up
+    change_column_null :issues, :lock_version, true
+    change_column_null :merge_requests, :lock_version, true
+  end
+
+  def down
+  end
+end
diff --git a/db/schema.rb b/db/schema.rb
index e1ce7085c62..963d528d170 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: 20160827011312) do
+ActiveRecord::Schema.define(version: 20160830232601) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
-- 
2.30.9