20181112103239_drop_default_value_on_status_deployments.rb 386 Bytes
Newer Older
1 2
# frozen_string_literal: true

3
class DropDefaultValueOnStatusDeployments < ActiveRecord::Migration[4.2]
4 5 6 7
  DOWNTIME = false
  DEPLOYMENT_STATUS_SUCCESS = 2 # Equivalent to Deployment.state_machine.states['success'].value

  def up
Shinya Maeda's avatar
Shinya Maeda committed
8
    change_column_default :deployments, :status, nil
9 10 11 12 13 14
  end

  def down
    change_column_default :deployments, :status, DEPLOYMENT_STATUS_SUCCESS
  end
end