diff --git a/db/migrate/20180115094742_add_default_project_creation_setting.rb b/db/migrate/20180115094742_add_default_project_creation_setting.rb index 22de39e16727b45846c56976d8d296b709127e2a..465a89c39e8642da5f31d5d1469d6259df2182a0 100644 --- a/db/migrate/20180115094742_add_default_project_creation_setting.rb +++ b/db/migrate/20180115094742_add_default_project_creation_setting.rb @@ -6,10 +6,14 @@ class AddDefaultProjectCreationSetting < ActiveRecord::Migration[4.2] disable_ddl_transaction! def up - add_column_with_default(:application_settings, :default_project_creation, :integer, default: 2) + unless column_exists?(:application_settings, :default_project_creation) + add_column_with_default(:application_settings, :default_project_creation, :integer, default: 2) + end end def down - remove_column(:application_settings, :default_project_creation) + if column_exists?(:application_settings, :default_project_creation) + remove_column(:application_settings, :default_project_creation) + end end end