solidusio / solidus

🛒 Solidus, the open-source eCommerce framework for industry trailblazers.
https://solidus.io
Other
5.02k stars 1.29k forks source link

DB Seed Scripts Exceeding max_questions Limit (MySQL) #2050

Closed pmn4 closed 7 years ago

pmn4 commented 7 years ago

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:

mamhoff commented 7 years ago

That'd be a great PR!

jhawthorn commented 7 years ago

Merged and fixed as #2097. Thanks!