Skip to content

Instantly share code, notes, and snippets.

@daveworth
Created December 27, 2011 17:27
Show Gist options
  • Select an option

  • Save daveworth/1524465 to your computer and use it in GitHub Desktop.

Select an option

Save daveworth/1524465 to your computer and use it in GitHub Desktop.
A gist of my multi-schema migration woes

I started by rolling back the last migrations

[ruby-1.9.2-p290@batchblue ~/../BatchBlue/BatchDeux(hg-mailchimp*)]> bundle exec rake db:rollback
WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /Users/dworth/.rvm/gems/ruby-1.9.2-p290@batchblue/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
    at /Users/dworth/.rvm/gems/ruby-1.9.2-p290@batchblue/gems/sunspot_rails-1.2.1/lib/sunspot/rails/tasks.rb:41:in `block in <top (required)>'
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
    at /Users/dworth/Documents/BatchBlue/BatchDeux/lib/tasks/multi_schema.rake:123:in `block (2 levels) in <top (required)>'
I'm in your mailbox redirecting your mail
==  AddExplicitTagsToContactImport: reverting =================================
-- add_column(:contact_imports, :tag_import, :string)
   -> 0.0064s
-- add_column(:contact_imports, :tag_with, :string)
   -> 0.0005s
-- remove_column(:contact_imports, :explicit_tags)
   -> 0.0032s
==  AddExplicitTagsToContactImport: reverted (0.0102s) ========================

Then I tried running the multi-schema rake (though I believed the workflow to be running the single-schema, then multi-schema, this was worth a shot)

[ruby-1.9.2-p290@batchblue ~/../BatchBlue/BatchDeux(hg-mailchimp*)]> bundle exec rake multi_schema:db:migrate 
WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /Users/dworth/.rvm/gems/ruby-1.9.2-p290@batchblue/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
    at /Users/dworth/.rvm/gems/ruby-1.9.2-p290@batchblue/gems/sunspot_rails-1.2.1/lib/sunspot/rails/tasks.rb:41:in `block in <top (required)>'
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
    at /Users/dworth/Documents/BatchBlue/BatchDeux/lib/tasks/multi_schema.rake:123:in `block (2 levels) in <top (required)>'
I'm in your mailbox redirecting your mail
migrating account 1 (batchblue)
migrating account 2 (verizon)

There was no apparent change so I ran the single-schema migration. This added/removed the necessary columns to the public schema

[ruby-1.9.2-p290@batchblue ~/../BatchBlue/BatchDeux(hg-mailchimp*)]> bundle exec rake db:migrate 
WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /Users/dworth/.rvm/gems/ruby-1.9.2-p290@batchblue/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
    at /Users/dworth/.rvm/gems/ruby-1.9.2-p290@batchblue/gems/sunspot_rails-1.2.1/lib/sunspot/rails/tasks.rb:41:in `block in <top (required)>'
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
    at /Users/dworth/Documents/BatchBlue/BatchDeux/lib/tasks/multi_schema.rake:123:in `block (2 levels) in <top (required)>'
I'm in your mailbox redirecting your mail
==  AddExplicitTagsToContactImport: migrating =================================
-- add_column(:contact_imports, :explicit_tags, :string)
   -> 0.0009s
-- remove_column(:contact_imports, :tag_import)
   -> 0.0006s
-- remove_column(:contact_imports, :tag_with)
   -> 0.0003s
==  AddExplicitTagsToContactImport: migrated (0.0020s) ========================

migrating account 1 (batchblue)
migrating account 2 (verizon)

Then I ran the multi-schema migrations again, still no change to the non-public schemas

[ruby-1.9.2-p290@batchblue ~/../BatchBlue/BatchDeux(hg-mailchimp*)]> bundle exec rake multi_schema:db:migrate 
WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /Users/dworth/.rvm/gems/ruby-1.9.2-p290@batchblue/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
    at /Users/dworth/.rvm/gems/ruby-1.9.2-p290@batchblue/gems/sunspot_rails-1.2.1/lib/sunspot/rails/tasks.rb:41:in `block in <top (required)>'
WARNING: 'task :t, arg, :needs => [deps]' is deprecated.  Please use 'task :t, [args] => [deps]' instead.
    at /Users/dworth/Documents/BatchBlue/BatchDeux/lib/tasks/multi_schema.rake:123:in `block (2 levels) in <top (required)>'
I'm in your mailbox redirecting your mail
migrating account 1 (batchblue)
migrating account 2 (verizon)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment