Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip schema.rb when schema_format is set to :sql #113

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

davqasd
Copy link
Contributor

@davqasd davqasd commented Aug 20, 2023

Fix for #93.
Behavior stays the same as it was for Rails 5 and above.
As it's said in the issue, we don't need to generate a schema.rb when we don't have the setting schema_format = :ruby.

@jenseng jenseng merged commit 16709ae into jenseng:master Jan 2, 2024
@@ -11,6 +11,8 @@ namespace :db do
namespace :schema do
desc "Create a db/schema.rb file that can be portably used against any DB supported by AR"
task :dump => :environment do
next unless ActiveRecord::Base.schema_format == :ruby

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to break db:migrate in recent versions of Rails:

NoMethodError: undefined method `schema_format' for ActiveRecord::Base:Class (NoMethodError)

It looks like ActiveRecord::Base.schema_format after Rails v3.2.13 was deprecated and removed. After that version it's just ActiveRecord.schema_format instead.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch @jasonopslevel! fixed in #118 and released in v1.1.1 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants