debian-mirror-gitlab/db/migrate/20200519194042_update_container_expiration_policies_defaults.rb

24 lines
730 B
Ruby
Raw Normal View History

2020-06-23 00:09:42 +05:30
# frozen_string_literal: true
class UpdateContainerExpirationPoliciesDefaults < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
with_lock_retries do
change_column_default :container_expiration_policies, :cadence, '1d'
change_column_default :container_expiration_policies, :keep_n, 10
change_column_default :container_expiration_policies, :older_than, '90d'
end
end
def down
with_lock_retries do
change_column_default :container_expiration_policies, :cadence, '7d'
change_column_default :container_expiration_policies, :keep_n, nil
change_column_default :container_expiration_policies, :older_than, nil
end
end
end