rails / solid_cable

A database backed ActionCable adapter
MIT License
217 stars 14 forks source link

Reversible upgrade migrations #33

Closed nickhammond closed 4 weeks ago

nickhammond commented 1 month ago

Just upgraded to 3.0 and I have standard running which flagged the new migrations as irreversible:

standard: Use Ruby Standard Style (https://github.com/standardrb/standard)
  db/cable_migrate/20240918204939_create_compact_channel.rb:5:5: Rails/ReversibleMigration: change_column is not reversible.
  db/cable_migrate/20240918204939_create_compact_channel.rb:8:5: Rails/ReversibleMigration: change_column is not reversible.

I just disabled the rules for those files but figured I'd mention it since I'm sure it'll start coming up as people upgrade. For those that land here and use standard you can just wrap the change method with disable/enable markers.

# frozen_string_literal: true

class CreateCompactChannel < ActiveRecord::Migration[7.2]
  def change
    # standard:disable Rails/ReversibleMigration
    # solid_cable upgrade migrations
    # standard:enable Rails/ReversibleMigration
  end
end
npezza93 commented 1 month ago

Happy to accept a pr that add a down method to that migration