logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/

20190511191044_set_default_state_to_reports.exs (559B)


  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. defmodule Pleroma.Repo.Migrations.SetDefaultStateToReports do
  5. use Ecto.Migration
  6. def up do
  7. execute("""
  8. UPDATE activities AS a
  9. SET data = jsonb_set(data, '{state}', '"open"', true)
  10. WHERE data->>'type' = 'Flag'
  11. """)
  12. end
  13. def down do
  14. execute("""
  15. UPDATE activities AS a
  16. SET data = data #- '{state}'
  17. WHERE data->>'type' = 'Flag'
  18. """)
  19. end
  20. end