diff --git a/config/settings.yml b/config/settings.yml index c317001..8888a8b 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -16,6 +16,8 @@ plugins: client: false solved_topics_auto_close_hours: default: 0 + min: 0 + max: 175200 # 20 years show_filter_by_solved_status: default: false client: true diff --git a/db/migrate/20210218022053_solved_fix_high_auto_close_topic_hours.rb b/db/migrate/20210218022053_solved_fix_high_auto_close_topic_hours.rb new file mode 100644 index 0000000..199e014 --- /dev/null +++ b/db/migrate/20210218022053_solved_fix_high_auto_close_topic_hours.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true +class SolvedFixHighAutoCloseTopicHours < ActiveRecord::Migration[6.0] + def up + execute <<-SQL + UPDATE site_settings + SET value = '175000' + WHERE name = 'solved_topics_auto_close_hours' + AND CAST(value AS INT) > 175000 + SQL + end + + def down + raise ActiveRecord::IrreversibleMigration + end +end