Fix db migration down task #586

Merged
merged 16 commits into from May 22, 2015

Projects

None yet

3 participants

@hansode
Member
hansode commented May 21, 2015

Problem

Some down tasks break db:down.

Steps to reproduce:

  1. Setup latest wakame-vdc environment.
  2. Setup seed data
  3. rake db:down
$ cd /opt/axsh/wakame-vdc/dcmgr
$ time /opt/axsh/wakame-vdc/ruby/bin/bundle exec rake db:down

TODO(not for this PR)

  • Still can't rollback data completely in 0014_migrate_localstore_to_volume.rb after applying this change.
  • Specify schema version.
    • Current db:down implementation rolls back to version=1.
    • rake db:migrate VERSION=xxx
hansode added some commits May 21, 2015
@hansode hansode add "down" task. 12aba07
@hansode hansode add "down" task. cbf729b
@hansode hansode add "down" task. 19944a3
@hansode hansode modify "down" task. 1ab67da
@hansode hansode modify "down" task. 9ba350d
@hansode hansode modify "down" task. e368473
@hansode hansode modify "down" task. 01ef385
@hansode hansode modify "down" task. 3886af6
@hansode hansode fix "down" task. 04513b2
@hansode hansode fix "down" task. 311adf8
@hansode hansode fix "down" task. bd75510
@hansode hansode fix following.
* Mysql2::Error: Unknown table 'network_vif_monitors'
* Mysql2::Error: Can't DROP 'vlan_leases_tag_id_index'; check that column/key exists
* Mysql2::Error: Can't DROP 'bridge'; check that column/key exists
* Mysql2::Error: Can't DROP 'bridge_type'; check that column/key exists
* Mysql2::Error: Unknown table 'backup_storages'
* Mysql2::Error: Can't DROP 'job_states_session_id_index'; check that column/key exists
* Mysql2::Error: Can't DROP 'command'; check that column/key exists

* rake aborted!
  wrong number of arguments (0 for 1..2)
  /opt/axsh/wakame-vdc/dcmgr/vendor/bundle/ruby/2.0.0/gems/sequel-3.47.0/lib/sequel/database/schema_generator.rb:371:in `add_index'
  /opt/axsh/wakame-vdc/dcmgr/config/db/migrations/0002_v1203.rb:534:in `block (3 levels) in <top (required)>'
cb6cb72
@hansode hansode fix "down" task. 2dd59ca
@hansode hansode fix "down" task. 197927c
@hansode hansode fix "down" task. 0f5848c
@hansode hansode add "down" task.
15bb517
@hansode hansode added the Type : Bug label May 21, 2015
@hansode hansode self-assigned this May 21, 2015
@axsh-bot
Member

15bb517 success - wakame-ci/rspec

@axsh-bot
Member

15bb517 success - wakame-ci/rpmbuild

@axsh-bot
Member

15bb517 success - wakame-ci/to-s3

@axsh-bot
Member

15bb517 success - wakame-ci/dummy.smoke

@axsh-bot
Member

15bb517 success - wakame-ci/kvm.smoke.allowed-failure

@axsh-bot
Member

15bb517 failure - wakame-ci/lxc.smoke.allowed-failure

@axsh-bot
Member

15bb517 success - wakame-ci/kvm.smoke

@axsh-bot
Member

15bb517 success - wakame-ci/vz.smoke

@Metallion
Member

Looks good to me. +1

@Metallion Metallion merged commit ebbd03c into master May 22, 2015

7 of 8 checks passed

wakame-ci/lxc.smoke.allowed-failure The build was failure on wakame-ci #21165 (15bb517c).
wakame-ci/dummy.smoke The build was success on wakame-ci #21163 (15bb517c).
wakame-ci/kvm.smoke The build was success on wakame-ci #21166 (15bb517c).
wakame-ci/kvm.smoke.allowed-failure The build was success on wakame-ci #21164 (15bb517c).
wakame-ci/rpmbuild The build was success on wakame-ci #21155 (15bb517c).
wakame-ci/rspec The build was success on wakame-ci #21153 (15bb517c).
wakame-ci/to-s3 The build was success on wakame-ci #21157 (15bb517c).
wakame-ci/vz.smoke The build was success on wakame-ci #21167 (15bb517c).
@hansode hansode deleted the fix-db-migration-down-task branch May 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment