Remove thing_type
and thing_id
columns from settings table (#31971)
This commit is contained in:
parent
b82c791770
commit
17c02c9210
6 changed files with 60 additions and 11 deletions
|
@ -0,0 +1,16 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RemoveLegacyUserSettingsData < ActiveRecord::Migration[7.2]
|
||||
def up
|
||||
connection.execute(<<~SQL.squish)
|
||||
DELETE FROM settings
|
||||
WHERE
|
||||
thing_type IS NOT NULL
|
||||
AND thing_id IS NOT NULL
|
||||
SQL
|
||||
end
|
||||
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue