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

Make structure.sql file configureable in db:structure:dump analog to SCHEMA in db:schema:dump #4019

Merged
merged 2 commits into from Dec 18, 2011

Conversation

kommen
Copy link
Contributor

@kommen kommen commented Dec 18, 2011

No description provided.

@josevalim
Copy link
Contributor

Why would you want to change the name? There are other places in Rails this file is referenced and if you change just in the rake task, it can cause bugs.

@kommen
Copy link
Contributor Author

kommen commented Dec 18, 2011

@josevalim: We run the same app against mysql and postgres (in different instances) and we'd like to use separate structure files for them as they obviously differ.

Can you point me to other uses of this file? I checked commit 15fb430 where the file name was changed the last time and it doesn't look like this affected other files then databases.rake.

@josevalim
Copy link
Contributor

We reference it here for dev reloading:

https://github.com/rails/rails/blob/master/activerecord/lib/active_record/railtie.rb#L106

But it seems yours is a production concern, so we are actually fine. A few
things just:

  1. Could you please rename the ENV variable from STRUCTURE to DB_STRUCTURE

  2. Please update the task description also to mention the new ENV var

  3. Please add a simple test here:
    https://github.com/rails/rails/blob/master/railties/test/application/rake_test.rb

Thanks!

@kommen
Copy link
Contributor Author

kommen commented Dec 18, 2011

Thanks a lot for your feedback José. I've addressed your suggestions.

josevalim added a commit that referenced this pull request Dec 18, 2011
Make structure.sql file configureable in db:structure:dump analog to SCHEMA in db:schema:dump
@josevalim josevalim merged commit 81deb34 into rails:master Dec 18, 2011
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

2 participants