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

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

Projects
None yet
2 participants
Contributor

kommen commented Dec 18, 2011

No description provided.

Contributor

josevalim commented Dec 18, 2011

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.

Contributor

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.

Contributor

josevalim commented Dec 18, 2011

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!

Contributor

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

Merge pull request #4019 from kommen/rake_db_structure
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