mirror of
https://github.com/discourse/discourse.git
synced 2026-08-08 17:53:55 +08:00
This commit promotes all post_deploy migrations which existed in Discourse v3.0.0 (timestamp <= 20221212234948)
9 lines
316 B
Ruby
Vendored
9 lines
316 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
class DeleteOrphanedChannels < ActiveRecord::Migration[7.0]
|
|
def up
|
|
DB.exec(
|
|
"DELETE FROM chat_channels WHERE chatable_type = 'Category' AND type = 'CategoryChannel' AND NOT EXISTS (SELECT * FROM categories WHERE categories.id = chat_channels.chatable_id)",
|
|
)
|
|
end
|
|
end
|