Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
4edf5213
Commit
4edf5213
authored
5 years ago
by
ThibG
Committed by
Eugen Rochko
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add post-deployment migration script to delete public-boosts-of-private-toots (#10783)
parent
ab829d4a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
db/post_migrate/20190519130537_remove_boosts_widening_audience.rb
+23
-0
23 additions, 0 deletions
...migrate/20190519130537_remove_boosts_widening_audience.rb
db/schema.rb
+1
-1
1 addition, 1 deletion
db/schema.rb
with
24 additions
and
1 deletion
db/post_migrate/20190519130537_remove_boosts_widening_audience.rb
0 → 100644
+
23
−
0
View file @
4edf5213
class
RemoveBoostsWideningAudience
<
ActiveRecord
::
Migration
[
5.2
]
disable_ddl_transaction!
def
up
public_boosts
=
Status
.
find_by_sql
(
<<-
SQL
)
SELECT boost.id
FROM statuses AS boost
LEFT JOIN statuses AS boosted ON boost.reblog_of_id = boosted.id
WHERE
boost.id > 101746055577600000
AND (boost.local = TRUE OR boost.uri IS NULL)
AND boost.visibility IN (0, 1)
AND boost.reblog_of_id IS NOT NULL
AND boosted.visibility = 2
SQL
RemovalWorker
.
push_bulk
(
public_boosts
.
pluck
(
:id
))
end
def
down
raise
ActiveRecord
::
IrreversibleMigration
end
end
This diff is collapsed.
Click to expand it.
db/schema.rb
+
1
−
1
View file @
4edf5213
...
...
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2019_05_1
1
_1
527
37
)
do
ActiveRecord
::
Schema
.
define
(
version:
2019_05_1
9
_1
305
37
)
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