Table `vanity_records` doesn't exist #96

Closed
siannopollo opened this Issue Feb 9, 2012 · 3 comments

3 participants

@siannopollo

I'm upgrading a rails app from 3.0.9 to 3.2.1 (ruby 1.9.3-p0). Everything is working nicely except vanity, which appears to be require a vanity_records table but provides no means to create one. I have one experiment in my app. I have vanity installed like so in my Gemfile: gem 'vanity', '~> 1.7.0', :git => 'git://github.com/assaf/vanity.git', :branch => 'rails3'

Here is the stacktrace:

** Invoke cucumber (first_time)
** Invoke cucumber:ok (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
Mysql2::Error: Table 'my_app_development.vanity_records' doesn't exist: SHOW FULL FIELDS FROM `vanity_records`
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:233:in `query'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:233:in `block in execute'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activesupport-3.2.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:233:in `execute'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/connection_adapters/mysql2_adapter.rb:214:in `execute'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:247:in `execute_and_free'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:414:in `columns'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/connection_adapters/schema_cache.rb:12:in `block in initialize'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/model_schema.rb:228:in `yield'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/model_schema.rb:228:in `default'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/model_schema.rb:228:in `columns'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/model_schema.rb:248:in `column_names'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/attribute_methods.rb:44:in `block in define_attribute_methods'
<internal:prelude>:10:in `synchronize'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/attribute_methods.rb:41:in `define_attribute_methods'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/validates_timeliness-3.0.8/lib/validates_timeliness/orm/active_record.rb:8:in `define_attribute_methods'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/attribute_methods.rb:43:in `block in define_attribute_methods'
<internal:prelude>:10:in `synchronize'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/attribute_methods.rb:41:in `define_attribute_methods'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/validates_timeliness-3.0.8/lib/validates_timeliness/orm/active_record.rb:8:in `define_attribute_methods'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/attribute_methods.rb:145:in `respond_to?'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:398:in `__run_callback'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:385:in `_run_find_callbacks'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activesupport-3.2.1/lib/active_support/callbacks.rb:81:in `run_callbacks'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/base.rb:520:in `init_with'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/inheritance.rb:76:in `instantiate'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/querying.rb:38:in `block (2 levels) in find_by_sql'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/querying.rb:38:in `collect!'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/querying.rb:38:in `block in find_by_sql'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/explain.rb:40:in `logging_query_plan'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/querying.rb:37:in `find_by_sql'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/relation.rb:170:in `exec_queries'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/relation.rb:159:in `block in to_a'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/explain.rb:40:in `logging_query_plan'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/relation.rb:158:in `to_a'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/relation/finder_methods.rb:377:in `find_first'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/relation/finder_methods.rb:122:in `first'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/relation/finder_methods.rb:263:in `find_by_attributes'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activerecord-3.2.1/lib/active_record/dynamic_matchers.rb:45:in `method_missing'
~/.rvm/gems/ruby-1.9.3-p0@my_app/bundler/gems/vanity-4a1385954cb9/lib/vanity/adapters/active_record_adapter.rb:148:in `set_experiment_created_at'
~/.rvm/gems/ruby-1.9.3-p0@my_app/bundler/gems/vanity-4a1385954cb9/lib/vanity/experiment/base.rb:172:in `save'
~/.rvm/gems/ruby-1.9.3-p0@my_app/bundler/gems/vanity-4a1385954cb9/lib/vanity/experiment/ab_test.rb:430:in `save'
~/.rvm/gems/ruby-1.9.3-p0@my_app/bundler/gems/vanity-4a1385954cb9/lib/vanity/experiment/base.rb:22:in `define'
~/.rvm/gems/ruby-1.9.3-p0@my_app/bundler/gems/vanity-4a1385954cb9/lib/vanity/experiment/ab_test.rb:502:in `ab_test'
~/Developer/Projects/Freelance/my_app/experiments/downgrade_subscriptions.rb:1:in `new_binding'
~/.rvm/gems/ruby-1.9.3-p0@my_app/bundler/gems/vanity-4a1385954cb9/lib/vanity/experiment/base.rb:53:in `eval'
~/.rvm/gems/ruby-1.9.3-p0@my_app/bundler/gems/vanity-4a1385954cb9/lib/vanity/experiment/base.rb:53:in `block in load'
~/.rvm/gems/ruby-1.9.3-p0@my_app/bundler/gems/vanity-4a1385954cb9/lib/vanity/experiment/base.rb:51:in `instance_eval'
~/.rvm/gems/ruby-1.9.3-p0@my_app/bundler/gems/vanity-4a1385954cb9/lib/vanity/experiment/base.rb:51:in `load'
~/.rvm/gems/ruby-1.9.3-p0@my_app/bundler/gems/vanity-4a1385954cb9/lib/vanity/playground.rb:140:in `block in experiments'
~/.rvm/gems/ruby-1.9.3-p0@my_app/bundler/gems/vanity-4a1385954cb9/lib/vanity/playground.rb:139:in `each'
~/.rvm/gems/ruby-1.9.3-p0@my_app/bundler/gems/vanity-4a1385954cb9/lib/vanity/playground.rb:139:in `experiments'
~/.rvm/gems/ruby-1.9.3-p0@my_app/bundler/gems/vanity-4a1385954cb9/lib/vanity/playground.rb:157:in `load!'
~/.rvm/gems/ruby-1.9.3-p0@my_app/bundler/gems/vanity-4a1385954cb9/lib/vanity/frameworks/rails.rb:10:in `block in load!'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activesupport-3.2.1/lib/active_support/lazy_load_hooks.rb:34:in `call'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activesupport-3.2.1/lib/active_support/lazy_load_hooks.rb:34:in `execute_hook'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activesupport-3.2.1/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activesupport-3.2.1/lib/active_support/lazy_load_hooks.rb:42:in `each'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activesupport-3.2.1/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/railties-3.2.1/lib/rails/application/finisher.rb:59:in `block in <module:Finisher>'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/railties-3.2.1/lib/rails/initializable.rb:30:in `instance_exec'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/railties-3.2.1/lib/rails/initializable.rb:30:in `run'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/railties-3.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/railties-3.2.1/lib/rails/initializable.rb:54:in `each'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/railties-3.2.1/lib/rails/initializable.rb:54:in `run_initializers'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/railties-3.2.1/lib/rails/application.rb:136:in `initialize!'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/railties-3.2.1/lib/rails/railtie/configurable.rb:30:in `method_missing'
~/Developer/Projects/Freelance/my_app/config/environment.rb:5:in `<top (required)>'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `block in require'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:236:in `load_dependency'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/railties-3.2.1/lib/rails/application.rb:103:in `require_environment!'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/railties-3.2.1/lib/rails/application.rb:292:in `block (2 levels) in initialize_tasks'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
~/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
~/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
~/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
~/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
~/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
~/.rvm/gems/ruby-1.9.3-p0@my_app/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
~/.rvm/gems/ruby-1.9.3-p0@my_app/bin/rake:19:in `load'
~/.rvm/gems/ruby-1.9.3-p0@my_app/bin/rake:19:in `<main>'
Tasks: TOP => cucumber => cucumber:ok => db:test:prepare => db:abort_if_pending_migrations => environment
@siannopollo

I found someone who claims to have fixed this problem here, but I haven't tried it out yet.

@mhuggins

That person doesn't really have the right approach. Pull request #97 is more along the right lines. Anyway, +1 for getting this fixed!

@dougcole
Collaborator

This is fixed here 479802d and will go out with the next release, thanks!

@dougcole dougcole closed this Feb 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment