Commit d19f8fcc authored by Alex Buijs's avatar Alex Buijs

Change migration to rename concurrently

In order to prevent downtime, rename columns concurrently
parent eb996dc3
# frozen_string_literal: true
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class RenameApplicationSettingsSnowplowCollectorUriColumn < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def change
rename_column :application_settings, :snowplow_collector_uri, :snowplow_collector_hostname
disable_ddl_transaction!
def up
rename_column_concurrently :application_settings, :snowplow_collector_uri, :snowplow_collector_hostname
end
def down
cleanup_concurrent_column_rename :application_settings, :snowplow_collector_hostname, :snowplow_collector_uri
end
end
# frozen_string_literal: true
class CleanupApplicationSettingsSnowplowCollectorUriRename < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
disable_ddl_transaction!
def up
cleanup_concurrent_column_rename :application_settings, :snowplow_collector_uri, :snowplow_collector_hostname
end
def down
rename_column_concurrently :application_settings, :snowplow_collector_hostname, :snowplow_collector_uri
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment