3ec31dc157d3688a5c53dc65879318325ebf342a
[anni] / priv / repo / migrations / 20190412052952_add_user_info_fields.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Repo.Migrations.AddEmailNotificationsToUserInfo do
6   use Ecto.Migration
7
8   def up do
9     execute("
10     UPDATE users
11     SET info = info || '{
12       \"email_notifications\": {
13         \"digest\": false
14       }
15     }'")
16   end
17
18   def down do
19     execute("
20       UPDATE users
21       SET info = info - 'email_notifications'
22     ")
23   end
24 end