We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30912
    • 463 Posts
    Greetings all, Am i missing something here?, ive been trying to get this schema to parse for the best part of 3 hours and for the life of me I cannot see why it is failing to parse.

    <?xml version="1.0" encoding="UTF-8"?>
    <model package="specifications" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1">
    	<object class="Specs" table="specifications" extends="xPDOSimpleObject">
    		<field key="type" dbtype="varchar" precision="255" phptype="string" null="false" />
    		<field key="metric" dbtype="varchar" precision="5" phptype="string" null="false" />
    		<field key="d0" dbtype="text" phptype="string" null="false" default="0" />
    		<field key="d1" dbtype="text" phptype="string" null="false" />
    		<field key="d2" dbtype="text" phptype="string" null="false" />
    		<field key="d3" dbtype="text" phptype="string" null="false" />
    		<field key="d4" dbtype="text" phptype="string" null="false" />
    		<field key="d5" dbtype="text" phptype="string" null="false" />
    		<field key="l1" dbtype="text" phptype="string" null="false" />
    		<field key="l2" dbtype="text" phptype="string" null="false" />
    		<field key="l3" dbtype="text" phptype="string" null="false" />
    		<field key="l1k" dbtype="text" phptype="string" null="false" />
    		<field key="l1n" dbtype="text" phptype="string" null="false" />
    		<field key="size_code" dbtype="varchar" phptype="string" null="false" />
    		<field key="impd0" dbtype="text" phptype="string" null="false" />
    		<field key="impd1" dbtype="text" phptype="string" null="false" />
    		<field key="impd2" dbtype="text" phptype="string" null="false" />
    		<field key="impd3" dbtype="text" phptype="string" null="false" />
    		<field key="impd4" dbtype="text" phptype="string" null="false" />
    		<field key="impd5" dbtype="text" phptype="string" null="false" />
    		<field key="impl1" dbtype="text" phptype="string" null="false" />
    		<field key="impl2" dbtype="text" phptype="string" null="false" />
    		<field key="impl3" dbtype="text" phptype="string" null="false" />
    		<field key="slot_width" dbtype="text" phptype="string" null="false" />
    		<field key="slot_depth" dbtype="text" phptype="string" null="false" />
    		<field key="seat_size" dbtype="text" phptype="string" null="false" />
    		<field key="createdon" dbtype="datetime" phptype="datetime" null="true" />
    		<field key="createdby" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
    		<field key="editedon" dbtype="datetime" phptype="datetime" null="true" />
    		<field key="editedby" dbtype="int" precision="10" attributes="unsigned" phptype="integer" null="false" default="0" />
    		<field key="deleted" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
    		<field key="published" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
    	</object>
    </model>
    


    Which brings up this error:

    [2014-04-15 17:12:44] (ERROR @ /modx/assets/components/migx/connector.php) Could not create table `sid_specifications`
    SQL: CREATE TABLE `sid_specifications` (`id` INTEGER unsigned NOT NULL AUTO_INCREMENT, `type` VARCHAR(255) NOT NULL, `metric` VARCHAR(5) NOT NULL, `d0` VARCHAR NOT NULL DEFAULT '0', `d1` TEXT NOT NULL, `d2` TEXT NOT NULL, `d3` TEXT NOT NULL, `d4` TEXT NOT NULL, `d5` TEXT NOT NULL, `l1` TEXT NOT NULL, `l2` TEXT NOT NULL, `l3` TEXT NOT NULL, `l1k` TEXT NOT NULL, `l1n` TEXT NOT NULL, `size_code` VARCHAR NOT NULL, `impd0` TEXT NOT NULL, `impd1` TEXT NOT NULL, `impd2` TEXT NOT NULL, `impd3` TEXT NOT NULL, `impd4` TEXT NOT NULL, `impd5` TEXT NOT NULL, `impl1` TEXT NOT NULL, `impl2` TEXT NOT NULL, `impl3` TEXT NOT NULL, `slot_width` TEXT NOT NULL, `slot_depth` TEXT NOT NULL, `seat_size` TEXT NOT NULL, `createdon` DATETIME NULL, `createdby` INT(10) unsigned NOT NULL DEFAULT '0', `editedon` DATETIME NULL, `editedby` INT(10) unsigned NOT NULL DEFAULT '0', `deleted` TINYINT(1) unsigned NOT NULL DEFAULT '0', `published` TINYINT(1) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`)) ENGINE=MyISAM
    ERROR: Array
    (
        [0] => 42000
        [1] => 1064
        [2] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL DEFAULT '0', `d1` TEXT NOT NULL, `d2` TEXT NOT NULL, `d3` TEXT NOT NULL' at line 1
    )
    


    But the XML is valid and I cannot see any issues with the schema, but for some reason it wont parse and create the tables.... maybe i've overlooked something?

    Thanks

      • 4172
      • 5,888 Posts
      <field key="size_code" dbtype="varchar" phptype="string" null="false" />


      varchar without precision?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 30912
        • 463 Posts
        Doh, and this is why your a genius.

        Thanks Bruno.