Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mastofe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Pleroma
mastofe
Commits
18e1de6a
Unverified
Commit
18e1de6a
authored
6 years ago
by
Eugen Rochko
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Migrate old web push subscriptions to ensure deliveries (#7764)
parent
85470ec8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
db/migrate/20180609104432_migrate_web_push_subscriptions2.rb
+17
-0
17 additions, 0 deletions
db/migrate/20180609104432_migrate_web_push_subscriptions2.rb
db/schema.rb
+1
-1
1 addition, 1 deletion
db/schema.rb
with
18 additions
and
1 deletion
db/migrate/20180609104432_migrate_web_push_subscriptions2.rb
0 → 100644
+
17
−
0
View file @
18e1de6a
class
MigrateWebPushSubscriptions2
<
ActiveRecord
::
Migration
[
5.2
]
disable_ddl_transaction!
def
up
Web
::
PushSubscription
.
where
(
user_id:
nil
).
select
(
:id
).
includes
(
:session_activation
).
find_each
do
|
subscription
|
if
subscription
.
session_activation
.
nil?
subscription
.
delete
else
subscription
.
update_attribute
(
:user_id
,
subscription
.
session_activation
.
user_id
)
end
end
end
def
down
# Nothing to do
end
end
This diff is collapsed.
Click to expand it.
db/schema.rb
+
1
−
1
View file @
18e1de6a
...
...
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2018_0
5_28_141303
)
do
ActiveRecord
::
Schema
.
define
(
version:
2018_0
6_09_104432
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment