summaryrefslogtreecommitdiff
path: root/db/migrate/20200524104346_add_source_to_resource_state_event.rb
blob: a1d1575bb02a9c25832b19b27b316cc58459b8f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

class AddSourceToResourceStateEvent < ActiveRecord::Migration[6.0]
  include Gitlab::Database::MigrationHelpers

  DOWNTIME = false

  disable_ddl_transaction!

  def up
    unless column_exists?(:resource_state_events, :source_commit)
      add_column :resource_state_events, :source_commit, :text
    end

    add_text_limit :resource_state_events, :source_commit, 40
  end

  def down
    remove_column :resource_state_events, :source_commit
  end
end