Commit 44be5883 authored by Matija Čupić's avatar Matija Čupić

Use add_column_with_default in migration

parent 78ae2304
...@@ -7,9 +7,13 @@ class AddDeployStrategyToProjectAutoDevops < ActiveRecord::Migration ...@@ -7,9 +7,13 @@ class AddDeployStrategyToProjectAutoDevops < ActiveRecord::Migration
# Set this constant to true if this migration requires downtime. # Set this constant to true if this migration requires downtime.
DOWNTIME = false DOWNTIME = false
def change disable_ddl_transaction!
change_table :project_auto_devops do |t|
t.integer :deploy_strategy, null: false, default: 0 def up
end add_column_with_default :project_auto_devops, :deploy_strategy, :integer, default: 0, allow_null: false
end
def down
remove_column :project_auto_devops, :deploy_strategy
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment