summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2021-07-17 20:35:35 -0500
committerAlex Gleason <alex@alexgleason.me>2021-07-17 22:19:38 -0500
commit0114754db2d9dde25b31729644f898f20121de27 (patch)
tree72c5f8bf0890ebbcf2f7876db99e1308b28689f9 /priv
parentb221d77a6da07c684bdbc63ddf4500e0d7ffeae8 (diff)
MastodonAPI: Support poll notification
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