standalone-migrations
standalone-migrations copied to clipboard
v 7.1.0 | NoMethodError: undefined method `schema_file' for primary:Module
rake db:*any_command*
fails with error:
DEPRECATION WARNING: ActiveRecord::Base.schema_format is deprecated and will be removed in Rails 7.1
Use `ActiveRecord.schema_format` instead.
(called from <top (required)> at /Users/__/__/Rakefile:9)
rake aborted!
NoMethodError: undefined method `schema_file' for primary:Module
Did you mean? schema_file_type
/Users/__/__/Rakefile:9:in `<top (required)>'
/Users/__/.rvm/rubies/ruby-3.0.1/bin/ruby_executable_hooks:22:in `eval'
/Users/__/.rvm/rubies/ruby-3.0.1/bin/ruby_executable_hooks:22:in `<main>'
(See full trace by running task with --trace)
Couldn't find any solution but to switch back on 6.1
gem "standalone_migrations", "~> 6.1"
Rakefile:
# frozen_string_literal: true
require 'standalone_migrations'
ENV["RACK_ENV"] ||= "development"
Rake.add_rakelib("rakelib/**")
StandaloneMigrations::Tasks.load_tasks <-- Rakefile:9:in `<top (required)>' points here
Yep, this is the issue I mentioned in #167
Workaround: Until a fix is provided, I have the environment variable SCHEMA
set to 'db/schema.rb'
and it works for me.
So set -x SCHEMA 'db/schema.rb'
.
I want to reduce manual effort and potential for errors with others though.
So I used this instead:
gem 'standalone_migrations', git: 'https://github.com/vovka/standalone-migrations'
Seems the hyphen worked for the main gem version, but to use an unregistered alternate, it would only recognize the underscored name, and this project, apart from mlrazz's, had less errors, or required less manual effort to utilize.
This is still an issue. Is there a longer term solution other than adding an ENV?
I think this can be closed now #171 has been merged
wow