We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40944
    • 78 Posts
    Hi all,

    Some time ago already I created a website (as a hobby) for a horse club with a custom component for contest management. It is a simple component really: I just developed it in place, it has a single database table (should have used multiple but it's fine this way).

    Anyhow.. today they approached me saying that the points contestants are given can now also be half points. Because this was previously out of the question I created the component taking integers into account. Now I have to change the component code to use floats instead, that's all OK.. but the thing I am concerned about is the database and the model.

    If I understand correctly I can just update the schema and then run Bob's script again to update everything (as it has been some years I don't remember how this worked exactly, but I will figure that out).

    Is it really as simple as I just said or am I missing something? Do I have to take other things into account?

    Kind regards,
    Erwin

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

    • discuss.answer
      • 3749
      • 24,544 Posts
      I think modifying the schema and running the script again, then manually modifying that field in the DB in PhpMyAdmin would do it, but I'm not sure.

      Be sure to back up all custom tables referred to in the schema in PhpMyAdmin before doing anything.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 40944
        • 78 Posts
        Hi Bob,

        Thank you for your reply. I just tried it. I actually ended up not using the script for generating the map file because I just had to change one column from int to decimal/float. Did that in the schema (for good measure) and the map file. Then I used PhpMyAdmin to change the type of the database column and just refreshed the page and tried with a decimal value.

        That worked and it's really nice that it was this easy.

        Again thank you for your reply smiley

        Kind ragards,
        Erwin
          • 3749
          • 24,544 Posts
          That sounds like a good solution. BTW, MODX ignores the schema and uses only the class and map files.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting