mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:49:14 +08:00
25138db433
This commit promotes all post_deploy migrations which existed in Discourse v3.0.0 (timestamp <= 20221212234948)
33 lines
698 B
Ruby
33 lines
698 B
Ruby
# 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
|