Skip to content
This repository

Rake db:migrate and ..."doesn't exist: SHOW FULL FIELDS FROM"... #1273

Open
swistaczek opened this Issue August 08, 2012 · 6 comments

6 participants

Ernest Bursa Eric Hochberger willfults Benoit Bénézech Brunno Gomes amritdeep
Ernest Bursa

Hi,
I have added `rails_admin do block to couple models. When I try to deploy my app, and rake db:migrate runs I get following error:

 ** [out :: zobacz.re] rake aborted!
 ** [out :: zobacz.re] Mysql2::Error: Table 'homecard_staging.profit_cards' doesn't exist: SHOW FULL FIELDS FROM `profit_cards`
 ** [out :: zobacz.re] 
 ** [out :: zobacz.re] Tasks: TOP => db:migrate => environment
 ** [out :: zobacz.re] (See full trace by running task with --trace)
    command finished in 6480ms
*** [deploy:update_code] rolling back

Thanks in advantage for any help or suggestions.

Stack trace:

** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Invoke disable_rails_admin_initializer (first_time)
** Execute disable_rails_admin_initializer
** Execute environment
rake aborted!
Mysql2::Error: Table 'homecard_staging.profit_cards' doesn't exist: SHOW FULL FIELDS FROM `profit_cards`
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:243:in `query'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:243:in `block in execute'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:243:in `execute'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:211:in `execute'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:257:in `execute_and_free'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:424:in `columns'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/connection_adapters/schema_cache.rb:12:in `block in initialize'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/model_schema.rb:228:in `yield'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/model_schema.rb:228:in `default'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.6/lib/active_record/model_schema.rb:228:in `columns'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/rails_admin-0.0.5/lib/rails_admin/adapters/active_record.rb:83:in `properties'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/rails_admin-0.0.5/lib/rails_admin/config/fields.rb:50:in `factory'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/rails_admin-0.0.5/lib/rails_admin/config/has_fields.rb:129:in `_fields'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/rails_admin-0.0.5/lib/rails_admin/config/has_fields.rb:127:in `_fields'
/home/homecard/app/staging/shared/bundle/ruby/1.9.1/gems/rails_admin-0.0.5/lib/rails_admin/config/has_fields.rb:7:in `field'
Ernest Bursa

Adding unless File.basename($0) == 'rake' to block do the job but this is so dirty solution :(.

Eric Hochberger

I'm also running into the same problem since moving my rails_admin from the deprecated initializer to the models. Any real fix?

willfults

+1 Getting a similar issue

Benoit Bénézech
Collaborator

Can you retry with

gem 'rails_admin', github: 'sferik/rails_admin'
Brunno Gomes

I had this issue too in a new project, using rails_admin 0.3.0 and devise 2.1.2.

I had to comment the "rails_admin do" part of the model so the migrations could run.

Also, the SKIP_RAILS_ADMIN_INITIALIZER=false doesn't deal with this (actually I don't know if it should, just mentioning).

amritdeep

I am getting "RailsAdmin initialization disabled by default. Pass SKIP_RAILS_ADMIN_INITIALIZER=false if you need it" this error, what should I do ????

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.