2017-04-05 22:53:57 +00:00
|
|
|
# rubocop:disable RemoveIndex
|
2016-08-03 17:21:22 +00:00
|
|
|
class AddUniqueIndexToListsLabelId < ActiveRecord::Migration
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
disable_ddl_transaction!
|
|
|
|
|
|
|
|
def up
|
|
|
|
add_concurrent_index :lists, [:board_id, :label_id], unique: true
|
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
|
|
|
remove_index :lists, column: [:board_id, :label_id] if index_exists?(:lists, [:board_id, :label_id], unique: true)
|
|
|
|
end
|
|
|
|
end
|