diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-06-06 19:14:39 +0200 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-06-06 19:14:39 +0200 |
commit | 44be58836c826dfc0fbfa6d58641d34f84e292fb (patch) | |
tree | 15c79dbc572d44e66168f6048be1c43e614e2c35 /db | |
parent | 78ae23045bae8a75775a11675afd5836fb8f318b (diff) | |
download | gitlab-ce-44be58836c826dfc0fbfa6d58641d34f84e292fb.tar.gz |
Use add_column_with_default in migration
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20180601213245_add_deploy_strategy_to_project_auto_devops.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/db/migrate/20180601213245_add_deploy_strategy_to_project_auto_devops.rb b/db/migrate/20180601213245_add_deploy_strategy_to_project_auto_devops.rb index d5ea25f02d4..6f50d428965 100644 --- a/db/migrate/20180601213245_add_deploy_strategy_to_project_auto_devops.rb +++ b/db/migrate/20180601213245_add_deploy_strategy_to_project_auto_devops.rb @@ -7,9 +7,13 @@ class AddDeployStrategyToProjectAutoDevops < ActiveRecord::Migration # Set this constant to true if this migration requires downtime. DOWNTIME = false - def change - change_table :project_auto_devops do |t| - t.integer :deploy_strategy, null: false, default: 0 - end + disable_ddl_transaction! + + def up + 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 |