summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2021-08-09 10:02:37 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2021-08-09 10:02:37 +0000
commit901204df2292419378a486a97fea9d3c70903a20 (patch)
treee7b2b68201819dce06079d4decfacaa4c8aa1043 /priv
parent6384d7803520f633a66d1cb9f76e3540863f92fb (diff)
parent85d71d4f1d433a168eb136ad88b651b6c1d1a4fc (diff)
Merge branch 'poll-notification' into 'develop'
MastodonAPI: Support poll notification See merge request pleroma/pleroma!3484
Diffstat (limited to 'priv')
-rw-r--r--priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs49
1 files changed, 49 insertions, 0 deletions
diff --git a/priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs b/priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs
new file mode 100644
index 000000000..9abf40b3d
--- /dev/null
+++ b/priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs
@@ -0,0 +1,49 @@
+defmodule Pleroma.Repo.Migrations.AddPollToNotificationsEnum do
+ use Ecto.Migration
+
+ @disable_ddl_transaction true
+
+ def up do
+ """
+ alter type notification_type add value 'poll'
+ """
+ |> execute()
+ end
+
+ def down do
+ alter table(:notifications) do
+ modify(:type, :string)
+ end
+
+ """
+ delete from notifications where type = 'poll'
+ """
+ |> execute()
+
+ """
+ drop type if exists notification_type
+ """
+ |> execute()
+
+ """
+ create type notification_type as enum (
+ 'follow',
+ 'follow_request',
+ 'mention',
+ 'move',
+ 'pleroma:emoji_reaction',
+ 'pleroma:chat_mention',
+ 'reblog',
+ 'favourite',
+ 'pleroma:report'
+ )
+ """
+ |> execute()
+
+ """
+ alter table notifications
+ alter column type type notification_type using (type::notification_type)
+ """
+ |> execute()
+ end
+end