mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Drop old hotlinked image data from post_custom_fields (#16594)
`20220428094026_create_post_hotlinked_media` moved this data into a dedicated table
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class DeleteHotlinkedImageCustomFields < ActiveRecord::Migration[7.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
execute <<~SQL
|
||||
DELETE FROM post_custom_fields
|
||||
WHERE name IN (
|
||||
'downloaded_images',
|
||||
'broken_images',
|
||||
'large_images'
|
||||
)
|
||||
SQL
|
||||
|
||||
execute <<~SQL
|
||||
DROP INDEX CONCURRENTLY IF EXISTS post_custom_field_broken_images_idx
|
||||
SQL
|
||||
|
||||
execute <<~SQL
|
||||
DROP INDEX CONCURRENTLY IF EXISTS post_custom_field_downloaded_images_idx
|
||||
SQL
|
||||
|
||||
execute <<~SQL
|
||||
DROP INDEX CONCURRENTLY IF EXISTS post_custom_field_large_images_idx
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user