I’m running into a wall in Craft when adding a boatload of fields. The error I’m getting is
SQLSTATE: Syntax error or access violation: 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs.
Basically, I’m migrating from an EE2 site that uses freeform, and two of their forms have hundreds of fields. I wrote a script to grab the freeform field info from the database, and generate a
JSON object that the Craft plugin “Field Manager” could use to import the fields (no way I’m creating them manually). But during that import is when I run into the above SQL error.
Some things I read suggest tweaking mysql settings, like changing to the Barracuda file format… but I don’t think I’ll be able to control that on our client’s hosting.
Other things suggested changing from
MyISAM, but that scares me as well. Aren’t foreign keys and transactions important?!
I’ve tried doing the import as one SuperTable containing all of the fields, so it would use a new database table, rather than putting them all in the craft_content table, but still ran into the limit.
And other things I’ve read suggest changing
VARCHAR fields to
TEXT (which seems counterintuitive to me…). I noticed that Craft creates all Dropdown type fields as
VARCHAR… and this import has a lot of those. I’m considering modifying craft (either temp hack or creating a custom Dropdown field type) to default to
TEXT for Dropdowns, which might get around the issue.
My questions are:
Is that safe to tweak the field type of a dropdown from
TEXT? Any weird repercussions I'm not seeing?
Would it be safe to switch the
craft_contenttable, or a supertable or matrix table, to
MyISAMto get around this limit?
And another route I could take is to modify the Feed Me plugin to be able to import into FreeForm, but I think I'd run into the same issue in FreeForm as well...
Another possible workaround I’ve thought of is to split my fields into multiple Matrix or SuperTable fields… but that seems dirty too. Any thoughts on that would be appreciated as well.