diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-03-07 19:08:53 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-03-07 19:09:01 +0300 |
commit | 5d9762b3b5ace3da397b83f501d103a5152f0dd3 (patch) | |
tree | bed282cc9a07e165842c6b28e18746c8558c0c21 /db/migrate/20160920160832_add_index_to_labels_title.rb | |
parent | 6a52cda31da4becc3e342530a2bdf0868d8921cc (diff) |
Add cop to ensure reversibility of add_concurrent_index
Diffstat (limited to 'db/migrate/20160920160832_add_index_to_labels_title.rb')
-rw-r--r-- | db/migrate/20160920160832_add_index_to_labels_title.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/db/migrate/20160920160832_add_index_to_labels_title.rb b/db/migrate/20160920160832_add_index_to_labels_title.rb index b5de552b98c..19f7b1076a7 100644 --- a/db/migrate/20160920160832_add_index_to_labels_title.rb +++ b/db/migrate/20160920160832_add_index_to_labels_title.rb @@ -5,7 +5,11 @@ class AddIndexToLabelsTitle < ActiveRecord::Migration disable_ddl_transaction! - def change + def up add_concurrent_index :labels, :title end + + def down + remove_index :labels, :title if index_exists? :labels, :title + end end |