Merge branch 'ssl_trusted_cert' into 'develop'
[akkoma] / priv / repo / migrations / 20190203185340_split_hide_network.exs
1 defmodule Pleroma.Repo.Migrations.SplitHideNetwork do
2 use Ecto.Migration
3
4 def up do
5 execute("UPDATE users SET info = jsonb_set(info, '{hide_network}'::text[], 'false'::jsonb) WHERE NOT(info::jsonb ? 'hide_network') AND local")
6 execute("UPDATE users SET info = jsonb_set(info, '{hide_followings}'::text[], info->'hide_network') WHERE local")
7 execute("UPDATE users SET info = jsonb_set(info, '{hide_followers}'::text[], info->'hide_network') WHERE local")
8 end
9
10 def down do
11 end
12 end