summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-11-13 13:35:47 +0000
committerlain <lain@soykaf.club>2020-11-13 13:35:47 +0000
commit0d149502fe8397df6f374b44f1b0087d05cadecb (patch)
tree5a62aaf428f725e9af73542ca970d7ba4bf342a1 /priv
parent0597571fcac7a7e180b67797868a4ffa0f8a4f0b (diff)
parent70e4b86250da9ef97a836f497510c36bf22fa905 (diff)
downloadpleroma-0d149502fe8397df6f374b44f1b0087d05cadecb.tar.gz
pleroma-0d149502fe8397df6f374b44f1b0087d05cadecb.zip
Merge branch 'fixes_2034_reports_should_send_a_notification_to_admins' into 'develop'
fixes 2034 Make notifs view work for reports Closes #2034 See merge request pleroma/pleroma!2912
Diffstat (limited to 'priv')
-rw-r--r--priv/repo/migrations/20200831152600_add_pleroma_report_to_enum_for_notifications.exs48
1 files changed, 48 insertions, 0 deletions
diff --git a/priv/repo/migrations/20200831152600_add_pleroma_report_to_enum_for_notifications.exs b/priv/repo/migrations/20200831152600_add_pleroma_report_to_enum_for_notifications.exs
new file mode 100644
index 000000000..01fb90459
--- /dev/null
+++ b/priv/repo/migrations/20200831152600_add_pleroma_report_to_enum_for_notifications.exs
@@ -0,0 +1,48 @@
+defmodule Pleroma.Repo.Migrations.AddPleromaReportTypeToEnumForNotifications do
+ use Ecto.Migration
+
+ @disable_ddl_transaction true
+
+ def up do
+ """
+ alter type notification_type add value 'pleroma:report'
+ """
+ |> execute()
+ end
+
+ def down do
+ alter table(:notifications) do
+ modify(:type, :string)
+ end
+
+ """
+ delete from notifications where type = 'pleroma:report'
+ """
+ |> 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'
+ )
+ """
+ |> execute()
+
+ """
+ alter table notifications
+ alter column type type notification_type using (type::notification_type)
+ """
+ |> execute()
+ end
+end