From 20c599fb69150d96e37654c81f981fa1f09d85d2 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Tue, 25 Jun 2024 11:45:37 -0400 Subject: [PATCH] Fix `Rails/ReversibleMigration` cop for `drop_table` --- db/migrate/20170205175257_remove_devices.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/db/migrate/20170205175257_remove_devices.rb b/db/migrate/20170205175257_remove_devices.rb index 643e196bf33..d4af5ab6133 100644 --- a/db/migrate/20170205175257_remove_devices.rb +++ b/db/migrate/20170205175257_remove_devices.rb @@ -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