thuss/standalone-migrations

Supporting Rails 7

jaredcwhite opened this issue · 4 comments

Any thoughts on cutting a new gem release to support Rails 7? I forked and bumped up the version constraints, and it seems to be working except for an issue with some schema file name/type stuff which had been deprecated or removed in Rails 7. I worked around that simply by manually setting ENV['schema'], but I'm not sure what's the best long-term solution.

Ah, I see a new gem was released a few days ago, but as mentioned there's still one issue with the schema code differences (though thankfully there's a ENV-based workaround for now).

For anybody wondering, and trying out the mentioned solution, simply prefix your commands with SCHEMA='' rake db:*whatever_command*.

Or set the variable in your session by running export SCHEMA='' and proceeding with your work.

i added:

ENV["SCHEMA"] = File.join(ActiveRecord::Tasks::DatabaseTasks.db_dir, "schema.rb")
StandaloneMigrations::Tasks.load_tasks
thuss commented

The gem now officially supports rails 7 abd unit tests run against 7 without failing