Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Register
Sign in
Toggle navigation
Menu
Open sidebar
Tiger Ton
mastodon
Commits
a6815a75
Commit
a6815a75
authored
5 years ago
by
ThibG
Committed by
Eugen Rochko
5 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Add post-deployment migration script to delete public-boosts-of-private-toots (#10783)
parent
d587a943
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
db/post_migrate/20190519130537_remove_boosts_widening_audience.rb
+23
-0
...migrate/20190519130537_remove_boosts_widening_audience.rb
db/schema.rb
+1
-1
db/schema.rb
with
24 additions
and
1 deletion
+24
-1
db/post_migrate/20190519130537_remove_boosts_widening_audience.rb
0 → 100644
+
23
-
0
View file @
a6815a75
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 @
a6815a75
...
...
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2019_0
4_20_025523
)
do
ActiveRecord
::
Schema
.
define
(
version:
2019_0
5_19_130537
)
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.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment