20180906101639_add_user_ping_consent_to_application_settings.rb 585 Bytes
Newer Older
1 2
# frozen_string_literal: true

3
class AddUserPingConsentToApplicationSettings < ActiveRecord::Migration[4.2]
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    add_column :application_settings, :usage_stats_set_by_user_id, :integer
    add_concurrent_foreign_key :application_settings, :users, column: :usage_stats_set_by_user_id, on_delete: :nullify
  end

  def down
    remove_foreign_key :application_settings, column: :usage_stats_set_by_user_id
    remove_column :application_settings, :usage_stats_set_by_user_id
  end
end