Add option to modify HTTP pool size
[akkoma] / priv / repo / migrations / 20191220174645_add_scopes_to_pleroma_feo_auth_records.exs
1 defmodule Pleroma.Repo.Migrations.AddScopesToPleromaFEOAuthRecords do
2 use Ecto.Migration
3
4 def up do
5 update_scopes_clause = "SET scopes = '{read,write,follow,push,admin}'"
6 apps_where = "WHERE apps.client_name like 'PleromaFE_%' or apps.client_name like 'AdminFE_%'"
7 app_id_subquery_where = "WHERE app_id IN (SELECT apps.id FROM apps #{apps_where})"
8
9 execute("UPDATE apps #{update_scopes_clause} #{apps_where}")
10
11 for table <- ["oauth_authorizations", "oauth_tokens"] do
12 execute("UPDATE #{table} #{update_scopes_clause} #{app_id_subquery_where}")
13 end
14 end
15
16 def down, do: :noop
17 end