about summary refs log tree commit diff
path: root/db/migrate
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20200510110808_reset_web_app_secret.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20200510110808_reset_web_app_secret.rb b/db/migrate/20200510110808_reset_web_app_secret.rb
new file mode 100644
index 000000000..b274844c5
--- /dev/null
+++ b/db/migrate/20200510110808_reset_web_app_secret.rb
@@ -0,0 +1,15 @@
+class ResetWebAppSecret < ActiveRecord::Migration[5.2]
+  disable_ddl_transaction!
+
+  def up
+    web_app = Doorkeeper::Application.find_by(superapp: true)
+
+    return if web_app.nil?
+
+    web_app.renew_secret
+    web_app.save!
+  end
+
+  def down
+  end
+end