summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2017-03-09 19:23:36 +0200
committerValery Sizov <valery@gitlab.com>2017-03-14 14:11:59 +0200
commit67686e38fdb1d9c427a39ff1862af691ccd4e598 (patch)
treebe45741d556724caa1b87ecdd04bc22739d5a30a /db
parent96fe1856da46517b028fe0ddac89f314f25c8855 (diff)
downloadgitlab-ce-67686e38fdb1d9c427a39ff1862af691ccd4e598.tar.gz
Added migration to reset existing relative_position for issues
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20170309171644_reset_relative_position_for_issue.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/db/post_migrate/20170309171644_reset_relative_position_for_issue.rb b/db/post_migrate/20170309171644_reset_relative_position_for_issue.rb
new file mode 100644
index 00000000000..ce4be131d40
--- /dev/null
+++ b/db/post_migrate/20170309171644_reset_relative_position_for_issue.rb
@@ -0,0 +1,18 @@
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class ResetRelativePositionForIssue < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ execute <<-EOS
+ UPDATE issues SET relative_position = NULL
+ WHERE issues.relative_position IS NOT NULL;
+ EOS
+ end
+
+ def down
+ end
+end