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

Closed
Arsen7 opened this Issue Mar 14, 2012 · 3 comments

Comments

Projects
None yet
3 participants
@Arsen7
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

This comment has been minimized.

Show comment
Hide comment
@kennyj

kennyj Mar 17, 2012

Contributor

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.

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

This comment has been minimized.

Show comment
Hide comment
@kennyj

kennyj Mar 17, 2012

Contributor

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

Contributor

kennyj commented Mar 17, 2012

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

@kennyj

This comment has been minimized.

Show comment
Hide comment
@kennyj

kennyj Mar 17, 2012

Contributor

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

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

Merge pull request #5486 from kennyj/fix_5435
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

Merge pull request #5493 from kennyj/fix_5435-32
[3-2-stable] Fix GH #5435. db:structure:dump should be re-enable.

@drogus drogus closed this Mar 18, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment