We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37165
    • 89 Posts
    I have a MIGXDB. It works great. I needed to add a new field. So first I went to my Schema and added a new field called, "artistLastName"

    Then I went to the Componets >MIGX area and pushed the ADD field button. Got a success message. Then I parsed it an updated my indexes. I got success messages for all three. Next I went over to edit my form tabs and grid columns. No problem there. When I go to the MIGXDB I can see my new field but when I type in it and hit done the content disappears. As if it was never there. What am I missing?

    I'll paste my Schema code below. The new field is called "artistLastName"

    <?xml version="1.0" encoding="UTF-8"?>
    <model package="artwork" baseClass="xPDOObject" platform="mysql" defaultEngine="MyISAM" version="1.1">
            <object class="artWorks" table="artwork" extends="xPDOSimpleObject" >
             <field key="artist_resource_id" dbtype="text" phptype="string" null="false" default="" />
             <field key="exhibition_resource_id" dbtype="text" phptype="string" null="false" default="" />
             <field key="artFair_resource_id" dbtype="text" phptype="string" null="false" default="" />
             <field key="image" dbtype="varchar" precision="255" phptype="string" null="false" default="" />
            <field key="title" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
            <field key="videoLink" dbtype="text" phptype="json" null="false" default="" />
            <field key="artistName" precision="255" dbtype="varchar" phptype="string" null="false" default="" />
            <field key="artistLastName" precision="255" dbtype="varchar" phptype="string" null="false" default="" />
            <field key="extendedOne" dbtype="text" phptype="string" null="false" default="" />
            <field key="extendedTwo" dbtype="text" phptype="string" null="false" default="" />
            <field key="extendedThree" dbtype="text" phptype="string" null="false" default="" />
            <field key="media" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
            <field key="sizes" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
            <field key="edition" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
            <field key="sold" dbtype="tinyint" precision="1" attributes="unsigned" phptype="integer" null="false" default="0" />
            <field key="tagOne" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
            <field key="tagTwo" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
            <field key="tagthree" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
            <field key="tagFour" dbtype="varchar" precision="255" phptype="string" null="false" default="" index="index" />
            </object>
    </model>

    This question has been answered by rrswans. See the first response.

      • 4172
      • 5,888 Posts
      Did you check, if the field was created in the db and if its in the .map-file?
      It should after clicking 'add fields', but may be something went wrong, for example no write-permissions for php to your .map-files
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 37165
        • 89 Posts
        Hi Bruno! It's not in the map file. Can I add it there manually? Or is there another way I should go about this?
          • 4172
          • 5,888 Posts
          you need to make sure php has write-permissions to the .map-file

          you can try to remove them and do 'parse schema' again.
          This should recreate your .map - files
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 37165
            • 89 Posts
            Hi Bruno, Please forgive me as I don't know much about php. So the file you are referring to is the artworks.map.inc.php file right? In the mySQL folder? My database is called artworks.

            I checked that file and it does have permission. I tried to add the field again and then parse it with no luck.

            Are you saying that I should delete my artworks.map.inc.php file completely. Then add all the fields and parse the data?
              • 4172
              • 5,888 Posts
              yes, you can delete this artworks.map.inc.php file or rename it to artworks.map.inc.php.backup

              But you don't need to add the fields to your schema again, if you did that allready.

              After you have deleted the .map - file and you click the 'parse schema' - button
              The .map - file should be created with all fields now.

              After that, you can click the button 'Add fields'
              This should add the new fields to your table.
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 37165
                • 89 Posts
                Humm.... so when I did that, everything from my database disappeared, and when I went to create a new entry I could not even save anything. I get the following error message:

                quip.thread_err_save

                It won't save anything. I have the back-up so I can put it back together, but not sure what I'm doing wrong.

                Is there step by step instructions somewhere on how to do this? I've been adding my new field directly to the Schema file on my server. Should I be doing it in the modx backend instead? [ed. note: rrswans last edited this post 12 years, 4 months ago.]
                • discuss.answer
                  • 37165
                  • 89 Posts
                  So the problem I was having was that I was not entering the name of the package into the "package name" field at the top of Components>MIGX. I'm really embarrassed to admit that, but figured I would write it here in case someone else was having the same issue. I only have one package, thats why it's didn't occur to me.

                  1. Add field in Schema
                  2. Type in name of package
                  3. Parse Schema
                  4. Click add fields