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

rake db:migrate:redo executes db:structure:dump only once #5435

Closed
Arsen7 opened this issue Mar 14, 2012 · 3 comments · Fixed by #5486
Closed

rake db:migrate:redo executes db:structure:dump only once #5435

Arsen7 opened this issue Mar 14, 2012 · 3 comments · Fixed by #5486

Comments

@Arsen7
Copy link
Contributor

Arsen7 commented Mar 14, 2012

In current branch 3-2-stable, when config.active_record.schema_format = :sql, the task rake db:migrate:redo dumps the database structure just after the first migration is rolled back, and never calls it again, so you are left with invalid structure file.

Apparently the task db:_dump is reset properly, but the task db:structure:dump is not, what may be seen in the last line of the trace:

rake db:migrate:redo --trace
** Invoke db:migrate:redo (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate:redo
** Invoke db:rollback (first_time)
** Invoke environment 
** Invoke db:load_config 
** Execute db:rollback
** Invoke db:_dump (first_time)
** Execute db:_dump
** Invoke db:structure:dump (first_time)
** Invoke environment 
** Execute db:structure:dump
** Invoke db:migrate (first_time)
** Invoke environment 
** Invoke db:load_config 
** Execute db:migrate
==  CreateSessions: migrating =================================================
-- create_table(:sessions)
NOTICE:  CREATE TABLE will create implicit sequence [...]
==  CreateSessions: migrated (0.1163s) ========================================

** Invoke db:_dump (first_time)
** Execute db:_dump
** Invoke db:structure:dump 
@kennyj
Copy link
Contributor

kennyj commented Mar 17, 2012

I can reproduce this issue. and I realize the cause of problem.
schema:dump and _dump are reenable, but structure:dump is not reenable in the current implement.
I'm going to this issue.

kennyj added a commit to kennyj/rails that referenced this issue Mar 17, 2012
@kennyj
Copy link
Contributor

kennyj commented Mar 17, 2012

I think that I fixed this issue.
Please test it :-)

@kennyj
Copy link
Contributor

kennyj commented Mar 17, 2012

I confirmed that this issue is solved on 3-2-stable.
Anyway, I'll send a PR :)

tenderlove added a commit that referenced this issue Mar 18, 2012
Fix GH #5435. db:structure:dump should be re-enable.
kennyj added a commit to kennyj/rails that referenced this issue Mar 18, 2012
drogus added a commit that referenced this issue Mar 18, 2012
[3-2-stable] Fix GH #5435. db:structure:dump should be re-enable.
@drogus drogus closed this as completed Mar 18, 2012
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 a pull request may close this issue.

3 participants