mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FIX: PM should never be allowed to have a category
FIX: TL3 should not be allowed to muck with PM titles
This commit is contained in:
@ -0,0 +1,9 @@
|
||||
class PrivateMessageShaveNoCategoryId < ActiveRecord::Migration
|
||||
def up
|
||||
execute "UPDATE topics SET category_id = NULL WHERE category_id IS NOT NULL AND archetype = \'private_message\'"
|
||||
execute "ALTER TABLE topics ADD CONSTRAINT pm_has_no_category CHECK (category_id IS NULL OR archetype <> 'private_message')"
|
||||
end
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user