From 0114754db2d9dde25b31729644f898f20121de27 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 17 Jul 2021 20:35:35 -0500 Subject: MastodonAPI: Support poll notification --- ...210717000000_add_poll_to_notifications_enum.exs | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs (limited to 'priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs') 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 -- cgit v1.2.3 From 17aa3644be13a31ff0e8da0275de049b58780470 Mon Sep 17 00:00:00 2001 From: Sean King Date: Fri, 25 Feb 2022 23:11:42 -0700 Subject: Copyright bump for 2022 --- .../repo/migrations/20210717000000_add_poll_to_notifications_enum.exs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs') diff --git a/priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs b/priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs index 9abf40b3d..3b3abf5cf 100644 --- a/priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs +++ b/priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs @@ -1,3 +1,7 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2022 Pleroma Authors +# SPDX-License-Identifier: AGPL-3.0-only + defmodule Pleroma.Repo.Migrations.AddPollToNotificationsEnum do use Ecto.Migration -- cgit v1.2.3 From 10886eeaa2d764193ce804b99b60d5eb006ee124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Sun, 1 Jan 2023 12:11:47 +0100 Subject: Bump copyright year MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs') diff --git a/priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs b/priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs index 3b3abf5cf..1b3e48da3 100644 --- a/priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs +++ b/priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2022 Pleroma Authors +# Copyright © 2017-2023 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Repo.Migrations.AddPollToNotificationsEnum do -- cgit v1.2.3 From e853cfe7c3438650fd0f95bfe69e2bccfe12390c Mon Sep 17 00:00:00 2001 From: lain Date: Mon, 2 Jan 2023 20:38:50 +0000 Subject: Revert "Merge branch 'copyright-bump' into 'develop'" This reverts merge request !3825 --- priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs') diff --git a/priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs b/priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs index 1b3e48da3..3b3abf5cf 100644 --- a/priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs +++ b/priv/repo/migrations/20210717000000_add_poll_to_notifications_enum.exs @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2023 Pleroma Authors +# Copyright © 2017-2022 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Repo.Migrations.AddPollToNotificationsEnum do -- cgit v1.2.3