Merge pull request 'Add dark and light theme mode to docs, detection, and button...
[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(
6 "UPDATE users SET info = jsonb_set(info, '{hide_network}'::text[], 'false'::jsonb) WHERE NOT(info::jsonb ? 'hide_network') AND local"
7 )
8
9 execute(
10 "UPDATE users SET info = jsonb_set(info, '{hide_followings}'::text[], info->'hide_network') WHERE local"
11 )
12
13 execute(
14 "UPDATE users SET info = jsonb_set(info, '{hide_followers}'::text[], info->'hide_network') WHERE local"
15 )
16 end
17
18 def down do
19 end
20 end