mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Move tag_group cleanup from post_migrate -> migrate (#16434)
There is no need to wait until after the deploy for this cleanup. In fact, running it later will mean there could be a window of a few minutes during which the site is broken.
The only requirement is that it runs after the broken `20220401130745_create_category_required_tag_groups` migration.
Followup to 39a6de3d73
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class RemoveCategoryRequiredTagGroupsWithoutTagGroups < ActiveRecord::Migration[6.1]
|
||||
def up
|
||||
execute <<~SQL
|
||||
DELETE FROM category_required_tag_groups
|
||||
WHERE id IN (
|
||||
SELECT crtg.id
|
||||
FROM category_required_tag_groups crtg
|
||||
LEFT OUTER JOIN tag_groups tg ON crtg.tag_group_id = tg.id
|
||||
WHERE tg.id IS NULL
|
||||
)
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user