This is absolutely a favor, as this is in response to something well outside the code base, but when seeding the database with countries and states, individual insert statements are used (I presume for re-runability), which results in > 3600 queries, and Heroku's max_questions limit is exceeded.
How do you feel about, in a first step, identifying all of the countries/states already in the database, and in a second step, combining the inserts into a single statement?
This is absolutely a favor, as this is in response to something well outside the code base, but when seeding the database with countries and states, individual insert statements are used (I presume for re-runability), which results in > 3600 queries, and Heroku's
max_questions
limit is exceeded.How do you feel about, in a first step, identifying all of the countries/states already in the database, and in a second step, combining the inserts into a single statement?
for reference, here is the Spree Core version of the seed script.
I will take a stab at a PR if you are comfortable with the change. thanks!
Steps to reproduce
Deploy the app to Heroku using MySQL and run
heroku run rake db:seed
Expected behavior
Databases seed scripts should complete
Actual behavior
Heroku's MySQL
max_questions
limit is hit, stopping the scripts.System configuration
Solidus Version:
2.3.0.alpha
(9e00618
)Extensions in use: