From 3b7cae19e6d882e54dd06ee5f638d9b7f4af8078 Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Tue, 20 Sep 2022 08:09:41 +0530 Subject: [PATCH] chore: Enable help center for self-hosted accounts (#5458) --- db/migrate/20220920014549_enable_help_center.rb | 12 ++++++++++++ db/schema.rb | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20220920014549_enable_help_center.rb diff --git a/db/migrate/20220920014549_enable_help_center.rb b/db/migrate/20220920014549_enable_help_center.rb new file mode 100644 index 000000000..8b9f72388 --- /dev/null +++ b/db/migrate/20220920014549_enable_help_center.rb @@ -0,0 +1,12 @@ +class EnableHelpCenter < ActiveRecord::Migration[6.1] + def change + return if ENV['DEPLOYMENT_ENV'] == 'cloud' + + Account.find_in_batches do |account_batch| + account_batch.each do |account| + account.enable_features('help_center') + account.save! + end + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 9b724b99e..a20a90f65 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_09_19_225556) do +ActiveRecord::Schema.define(version: 2022_09_20_014549) do # These are extensions that must be enabled in order to support this database enable_extension "pg_stat_statements"