debian-mirror-gitlab/db/post_migrate/20220111093534_remove_index_on_auto_stop_in.rb
2022-04-04 11:22:00 +05:30

18 lines
450 B
Ruby

# frozen_string_literal: true
class RemoveIndexOnAutoStopIn < Gitlab::Database::Migration[1.0]
TABLE = :environments
INDEX_NAME = 'index_environments_on_auto_stop_at'
COLUMN = :auto_stop_at
disable_ddl_transaction!
def up
remove_concurrent_index TABLE, COLUMN, where: 'auto_stop_at IS NOT NULL', name: INDEX_NAME
end
def down
add_concurrent_index TABLE, COLUMN, where: 'auto_stop_at IS NOT NULL', name: INDEX_NAME
end
end