Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
906B

  1. defmodule Pleroma.Repo.Migrations.AddPleromaReportTypeToEnumForNotifications do
  2. use Ecto.Migration
  3. @disable_ddl_transaction true
  4. def up do
  5. """
  6. alter type notification_type add value 'pleroma:report'
  7. """
  8. |> execute()
  9. end
  10. def down do
  11. alter table(:notifications) do
  12. modify(:type, :string)
  13. end
  14. """
  15. delete from notifications where type = 'pleroma:report'
  16. """
  17. |> execute()
  18. """
  19. drop type if exists notification_type
  20. """
  21. |> execute()
  22. """
  23. create type notification_type as enum (
  24. 'follow',
  25. 'follow_request',
  26. 'mention',
  27. 'move',
  28. 'pleroma:emoji_reaction',
  29. 'pleroma:chat_mention',
  30. 'reblog',
  31. 'favourite'
  32. )
  33. """
  34. |> execute()
  35. """
  36. alter table notifications
  37. alter column type type notification_type using (type::notification_type)
  38. """
  39. |> execute()
  40. end
  41. end