small medium large xlarge

09 Mar 2008, 20:36
Mark Lane (1 post)

Aloha everyone,

I have noticed some odd behavior from the check_pending_migrations code while watching the terminal window. The check_pending_migrations code results in this query being run 41 times when I start my application:

(1) (0.000086) SELECT version FROM schema_info

I have 39 tables including schema_info and 43 migrations.

This also happens right before the 41 queries above:

(0) (0.000000) Mysql::Error: Table ‘schema_info’ already exists: CREATE TABLE schema_info (version int(11)) vendor/plugins/query_stats/lib/active_record/connection_adapters/query_stats.rb:41:in execute' vendor/plugins/query_stats/lib/active_record/connection_adapters/query_stats.rb:40:in execute’ config/initializers/check_pending_migrations.rb:5:in `new’ config/initializers/check_pending_migrations.rb:5 config/environment.rb:13

Does anyone have any ideas about what might be causing this and how to fix it? I like the code, but I am not going to use it if it adds 41 queries to each startup.



You must be logged in to comment