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.

37 lines
665B

  1. defmodule Pleroma.Repo.Migrations.ChangeTypeToEnumForNotifications do
  2. use Ecto.Migration
  3. def up do
  4. """
  5. create type notification_type as enum (
  6. 'follow',
  7. 'follow_request',
  8. 'mention',
  9. 'move',
  10. 'pleroma:emoji_reaction',
  11. 'pleroma:chat_mention',
  12. 'reblog',
  13. 'favourite'
  14. )
  15. """
  16. |> execute()
  17. """
  18. alter table notifications
  19. alter column type type notification_type using (type::notification_type)
  20. """
  21. |> execute()
  22. end
  23. def down do
  24. alter table(:notifications) do
  25. modify(:type, :string)
  26. end
  27. """
  28. drop type notification_type
  29. """
  30. |> execute()
  31. end
  32. end