diff options
| author | marcin mikołajczak <git@mkljczk.pl> | 2022-04-25 12:39:36 +0200 |
|---|---|---|
| committer | marcin mikołajczak <git@mkljczk.pl> | 2022-04-25 14:08:31 +0200 |
| commit | 9423052e9217aa1358950d37c5c96b11d554b37a (patch) | |
| tree | e49a2c1252ee475783faa318d367f1b073740a70 /priv | |
| parent | 8517bc18aa0bb9d80b7601ac63573838e3252b21 (diff) | |
| download | pleroma-9423052e9217aa1358950d37c5c96b11d554b37a.tar.gz pleroma-9423052e9217aa1358950d37c5c96b11d554b37a.zip | |
Add "status" notification type
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Diffstat (limited to 'priv')
| -rw-r--r-- | priv/repo/migrations/20220319000000_add_status_to_notifications_enum.exs | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/priv/repo/migrations/20220319000000_add_status_to_notifications_enum.exs b/priv/repo/migrations/20220319000000_add_status_to_notifications_enum.exs new file mode 100644 index 000000000..62c0afb63 --- /dev/null +++ b/priv/repo/migrations/20220319000000_add_status_to_notifications_enum.exs @@ -0,0 +1,50 @@ +defmodule Pleroma.Repo.Migrations.AddStatusToNotificationsEnum do + use Ecto.Migration + + @disable_ddl_transaction true + + def up do + """ + alter type notification_type add value 'status' + """ + |> execute() + end + + def down do + alter table(:notifications) do + modify(:type, :string) + end + + """ + delete from notifications where type = 'status' + """ + |> 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', + 'poll + ) + """ + |> execute() + + """ + alter table notifications + alter column type type notification_type using (type::notification_type) + """ + |> execute() + end +end |
