diff options
Diffstat (limited to 'db/migrate/20200826073745_add_default_to_ci_pipeline_locked.rb')
-rw-r--r-- | db/migrate/20200826073745_add_default_to_ci_pipeline_locked.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/db/migrate/20200826073745_add_default_to_ci_pipeline_locked.rb b/db/migrate/20200826073745_add_default_to_ci_pipeline_locked.rb new file mode 100644 index 00000000000..e73963043d5 --- /dev/null +++ b/db/migrate/20200826073745_add_default_to_ci_pipeline_locked.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class AddDefaultToCiPipelineLocked < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + # Set this constant to true if this migration requires downtime. + DOWNTIME = false + + ARTIFACTS_LOCKED = 1 + UNLOCKED = 0 + + def up + with_lock_retries do + change_column_default :ci_pipelines, :locked, ARTIFACTS_LOCKED + end + end + + def down + with_lock_retries do + change_column_default :ci_pipelines, :locked, UNLOCKED + end + end +end |