Add a JSON field in an XML schema

Hi everyone I have the next issues,

I’m auto-generating tables with XML schema into my DB but I need to add a specific field with JSON type. For example, if I do

<field key="elements" dbtype="json" phptype="json" null="false" default=""/>

the table doesn’t appear, but if I change dbtype=“json” by text, the table appears without a problem.


Someone know what it’s the best solution without change the datatype from my workbench


When I tested it with your example it generated an error message in the error log:

BLOB, TEXT, GEOMETRY or JSON column 'elements' can't have a default value

So it should work if you remove default="".

without a default, null should be true, afaik


Hi, thanks for the help. sorry for not answering earlier.

With these tips my element now appears as Json type .

thank a lot.