diff --git a/db/migrate/20200530172450_delete_disable_account_registration_from_settings.rb b/db/migrate/20200530172450_delete_disable_account_registration_from_settings.rb new file mode 100644 index 000000000..e92b25783 --- /dev/null +++ b/db/migrate/20200530172450_delete_disable_account_registration_from_settings.rb @@ -0,0 +1,11 @@ +class DeleteDisableAccountRegistrationFromSettings < ActiveRecord::Migration[5.2] + def self.up + return unless HackathonConfig.find_by(var: 'disable_account_registration').present? + HackathonConfig.find_by(var: 'disable_account_registration').destroy + end + + def self.down + return unless HackathonConfig.find_by(var: 'disable_account_registration').nil? + HackathonConfig.create(var: 'disable_account_registration', value: false).save + end +end