MigrationHelper: Move notification backfilling to own module.
authorlain <lain@soykaf.club>
Tue, 9 Jun 2020 07:20:55 +0000 (09:20 +0200)
committerlain <lain@soykaf.club>
Tue, 9 Jun 2020 07:20:55 +0000 (09:20 +0200)
lib/pleroma/migration_helper/notification_backfill.ex [moved from lib/pleroma/migration_helper.ex with 97% similarity]
priv/repo/migrations/20200602125218_backfill_notification_types.exs
test/migration_helper/notification_backfill_test.exs [moved from test/migration_helper_test.exs with 91% similarity]

similarity index 97%
rename from lib/pleroma/migration_helper.ex
rename to lib/pleroma/migration_helper/notification_backfill.ex
index a20d27a0113715571c307fdd71430217b01cc7cc..09647d12a97c2d73712b99dd6b0342eca6839aa1 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.MigrationHelper do
+defmodule Pleroma.MigrationHelper.NotificationBackfill do
   alias Pleroma.Notification
   alias Pleroma.Object
   alias Pleroma.Repo
index 58943fad039d69e9632131ba35779a00f1925008..996d721ee6810f15a57e8ddd414c652b08537957 100644 (file)
@@ -2,7 +2,7 @@ defmodule Pleroma.Repo.Migrations.BackfillNotificationTypes do
   use Ecto.Migration
 
   def up do
-    Pleroma.MigrationHelper.fill_in_notification_types()
+    Pleroma.MigrationHelper.NotificationBackfill.fill_in_notification_types()
   end
 
   def down do
similarity index 91%
rename from test/migration_helper_test.exs
rename to test/migration_helper/notification_backfill_test.exs
index 1c81739873d05c0ca56381caa9295dec007d4c55..2a62a2b00212ecf2f21799599b5b222c4d7ba0f7 100644 (file)
@@ -2,11 +2,11 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.MigrationHelperTest do
+defmodule Pleroma.MigrationHelper.NotificationBackfillTest do
   use Pleroma.DataCase
 
   alias Pleroma.Activity
-  alias Pleroma.MigrationHelper
+  alias Pleroma.MigrationHelper.NotificationBackfill
   alias Pleroma.Notification
   alias Pleroma.Repo
   alias Pleroma.Web.CommonAPI
@@ -35,7 +35,7 @@ defmodule Pleroma.MigrationHelperTest do
 
       assert {5, nil} = Repo.update_all(Notification, set: [type: nil])
 
-      MigrationHelper.fill_in_notification_types()
+      NotificationBackfill.fill_in_notification_types()
 
       assert %{type: "mention"} =
                Repo.get_by(Notification, user_id: other_user.id, activity_id: post.id)