Fix `Rails/ReversibleMigration` cop for `drop_table`

pull/30834/head
Matt Jankowski 2024-06-25 11:45:37 -04:00
parent 845fe1c693
commit 06581e8022
1 changed files with 5 additions and 1 deletions

View File

@ -1,7 +1,11 @@
# frozen_string_literal: true
class RemoveDevices < ActiveRecord::Migration[5.0]
def change
def up
drop_table :devices if table_exists?(:devices)
end
def down
raise ActiveRecord::IrreversibleMigration
end
end