Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
e1bc37d1
Commit
e1bc37d1
authored
Jun 09, 2020
by
lain
Browse files
MigrationHelper: Move notification backfilling to own module.
parent
3b5282be
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/migration_helper.ex
→
lib/pleroma/migration_helper
/notification_backfill
.ex
View file @
e1bc37d1
...
...
@@ -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
...
...
priv/repo/migrations/20200602125218_backfill_notification_types.exs
View file @
e1bc37d1
...
...
@@ -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
...
...
test/migration_helper_test.exs
→
test/migration_helper
/notification_backfill
_test.exs
View file @
e1bc37d1
...
...
@@ -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
.
NotificationBackfill
Test
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 @@ test "it fills in missing notification types" 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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment