From 1497db75f5f4850f51082de326fa0b4d8574bf3b Mon Sep 17 00:00:00 2001 From: Valery Sizov Date: Tue, 7 Mar 2017 15:29:30 +0200 Subject: [PATCH] Fix AddRelativePositionToIssues migration --- .../20170131221752_add_relative_position_to_issues.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/db/migrate/20170131221752_add_relative_position_to_issues.rb b/db/migrate/20170131221752_add_relative_position_to_issues.rb index 28c3d1012ce..1baad0893e3 100644 --- a/db/migrate/20170131221752_add_relative_position_to_issues.rb +++ b/db/migrate/20170131221752_add_relative_position_to_issues.rb @@ -21,11 +21,17 @@ class AddRelativePositionToIssues < ActiveRecord::Migration # # To disable transactions uncomment the following line and remove these # comments: - # disable_ddl_transaction! + disable_ddl_transaction! - def change + def up add_column :issues, :relative_position, :integer add_concurrent_index :issues, :relative_position end + + def down + remove_column :issues, :relative_position + + remove_index :issues, :relative_position if index_exists? :issues, :relative_position + end end