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

Missing create_schema calls in schema.rb #303

Open
ryanb opened this issue Nov 27, 2024 · 7 comments
Open

Missing create_schema calls in schema.rb #303

ryanb opened this issue Nov 27, 2024 · 7 comments

Comments

@ryanb
Copy link

ryanb commented Nov 27, 2024

Steps to reproduce

Rails schema dump doesn't include create_schema calls in upcoming release due to #276.

Expected behavior

It would be nice if this were configurable. We have a few schemas that exist outside tenants that need to be included in schema.rb dump.

The only work-around appears to be to monkey-patch this monkey-patch to reverse the monkey-patch. 😉

Actual behavior

There's no way to configure it.

Let me know if you would like a PR to add a config option for this.

Thanks for your work on this gem! Looking forward to the next release.

@mnovelo
Copy link
Collaborator

mnovelo commented Nov 27, 2024

I think that's reasonable. Happy to look over a PR, but wait until after the next release to create it since I'm refactoring a lot of the specs right now. I should have the next release done soon

@ryanb
Copy link
Author

ryanb commented Nov 27, 2024

Thanks. If others need this same thing in the meantime, putting this in an initializer works to bring back the create_schema lines.

class ActiveRecord::ConnectionAdapters::PostgreSQL::SchemaDumper
  def schemas(stream)
    _original_schemas(stream)
  end
end

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Dec 28, 2024
@mnovelo
Copy link
Collaborator

mnovelo commented Dec 29, 2024

I plan to include this in the next version of the apartment gem

@mnovelo
Copy link
Collaborator

mnovelo commented Jan 9, 2025

This was not included in 3.2.0, but my hope is to include this in the next major version which I'm actively working on right now

@mnovelo
Copy link
Collaborator

mnovelo commented Jan 9, 2025

also, I'd love your input in #312

@ryanb
Copy link
Author

ryanb commented Jan 9, 2025

Thanks @mnovelo, I appreciate your work on this!

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

No branches or pull requests

2 participants