Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20191129134844_add_broadcast_type_to_broadcast_message.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 84d17f558d1f4b8c51820337f8b25a469498f7b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

class AddBroadcastTypeToBroadcastMessage < ActiveRecord::Migration[5.2]
  include Gitlab::Database::MigrationHelpers

  # Set this constant to true if this migration requires downtime.
  DOWNTIME = false
  BROADCAST_MESSAGE_BANNER_TYPE = 1

  disable_ddl_transaction!

  def up
    add_column_with_default(:broadcast_messages, :broadcast_type, :smallint, default: BROADCAST_MESSAGE_BANNER_TYPE)
  end

  def down
    remove_column(:broadcast_messages, :broadcast_type)
  end
end