I have a sql installer file for my custom Magento module. It attempts to insert many thousands of rows into a custom database table but it runs out of memory and the module doesn’t install.
Everything works fine if I put the table in manually with normal mysql and there is no ‘memory balloon’ doing it that way.
I would like my module to work as a module, without having to do anything manually on the command line. Is there any way I can break down my installer file or call some external routine to get the data in?
You could distribute a CSV file containing the data with your module and use MySQL’s LOAD DATA command to load the data into the table you create in your upgrade script.
Maybe something like:
You can, of course, run further queries if you need to process the data somehow.