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

Fix database tasks in test namespace. #4030

Merged
merged 1 commit into from Dec 19, 2011
Merged

Fix database tasks in test namespace. #4030

merged 1 commit into from Dec 19, 2011

Conversation

Juanmcuello
Copy link
Contributor

Commit 15fb430 introduced some issues.

Previously to that commit, when I executed rake db:test:clone_structure
the structure was dumped (to structure.sql) and then loaded again no matter whether
the config.active_record.schema_format was set to :sql or :ruby. That was OK
because I'm explicitly saying that I want the structure to be cloned.

Now, when I call the same task, although the structure is dumped, the loaded schema
depends on the value of the config.active_record.schema_format. So If I have it set
to :ruby and then I call rake db:test:clone_structure the loaded file is schema.rb and
not the structure.sql how it is supposed to be according to the name of the task and
its description.

The same thing happens when I call rake db:test:clone. When called,
a new schema.rb is created but the file used to load the schema depends on
config.active_record.schema_format. If I have it set to :sql, a new schema.rb
is created but the structure.sql file is used to create the database. So it is
not consistent.

This pull request solves the problem. When db:test:clone_structure is invoked, the
structure is dumped and then loaded into the test database. When db:test:clone is
invoked the schema is dumped and then loaded into the test database. None of these
tasks depends now on the value of config.active_record.schema_format

josevalim added a commit that referenced this pull request Dec 19, 2011
Fix database tasks in test namespace.
@josevalim josevalim merged commit a0edfb4 into rails:master Dec 19, 2011
@josevalim
Copy link
Contributor

Reverting because it broke the build:

http://travis-ci.org/#!/rails/rails/jobs/424116

josevalim added a commit that referenced this pull request Dec 19, 2011
This reverts commit a0edfb4, reversing
changes made to 4012fcf.
@Juanmcuello
Copy link
Contributor Author

Sorry, because the changes were in activerecord I just only run those tests, I should have run the whole test suit instead.

I fixed the problem and now tests pass. Should I create a new pull request?

@josevalim
Copy link
Contributor

please new pull request :)

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