Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Looking for schema_migrations column in schema_migrations table and blowing up #12

Open
scottspeidel opened this issue Feb 27, 2016 · 1 comment

Comments

@scottspeidel
Copy link

Hi,

I ran:

neo4apis activerecord all_models --import-all-associations

and got the following error:

/Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in `query': Mysql2::Error: Unknown column 'schema_migrations.' in 'order clause': SELECT  `schema_migrations`.* FROM `schema_migrations`  ORDER BY `schema_migrations`.`` ASC LIMIT 1000 (ActiveRecord::StatementInvalid)
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in `block in execute'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_adapter.rb:472:in `block in log'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/activesupport-4.2.5.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_adapter.rb:466:in `log'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in `execute'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/mysql2_adapter.rb:231:in `execute'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/mysql2_adapter.rb:235:in `exec_query'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/database_statements.rb:355:in `select'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/database_statements.rb:32:in `select_all'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/query_cache.rb:70:in `select_all'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/querying.rb:39:in `find_by_sql'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/relation.rb:639:in `exec_queries'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/relation.rb:515:in `load'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/relation.rb:243:in `to_a'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/relation/batches.rb:117:in `find_in_batches'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/activerecord-4.2.5.1/lib/active_record/relation/batches.rb:50:in `find_each'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/neo4apis-activerecord-0.9.1/lib/neo4apis/cli/activerecord.rb:82:in `block (2 levels) in import_models_or_tables'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/neo4apis-activerecord-0.9.1/lib/neo4apis/cli/activerecord.rb:75:in `each'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/neo4apis-activerecord-0.9.1/lib/neo4apis/cli/activerecord.rb:75:in `block in import_models_or_tables'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/neo4apis-0.9.0/lib/neo4apis/base.rb:54:in `batch'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/neo4apis-activerecord-0.9.1/lib/neo4apis/cli/activerecord.rb:74:in `import_models_or_tables'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/neo4apis-activerecord-0.9.1/lib/neo4apis/cli/activerecord.rb:54:in `all_models'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/thor-0.19.1/lib/thor/invocation.rb:115:in `invoke'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/thor-0.19.1/lib/thor.rb:235:in `block in subcommand'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/gems/neo4apis-0.9.0/bin/neo4apis:15:in `<top (required)>'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/bin/neo4apis:23:in `load'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/bin/neo4apis:23:in `<main>'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
    from /Users/scottspeidel/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>'
@scottspeidel scottspeidel changed the title Looking for schema_migrations table in schema_migrations table and blowing up Looking for schema_migrations column in schema_migrations table and blowing up Feb 27, 2016
@cheerfulstoic
Copy link
Contributor

Hi, sorry for the delay!

That's a somewhat odd error for the all_models command. That uses ActiveRecord::Base.descendants to get a list of the models in your app. Do you have a model for the schema_migrations table for some reason?

The all_tables command uses ActiveRecord::Base.connection.tables, so I can imagine that picking up the schema_migrations table

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants