How can I run a MySQL patch in EspoCRM?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • theBuzzyCoder
    Senior Member
    • Feb 2018
    • 102

    How can I run a MySQL patch in EspoCRM?

    Hi yuri , tanya ,

    I have a third party integration with espo for sending marketing emails. I am trying to save a new field from that application. In Espo, I am able to achieve it. But since this is a new update for the existing implementation, I would like to know how can update all the data in CRM which was passed before the new update was released. Like a MySQL patch.

    Objective:

    1. Hit the third-party API and get data
    2. Call entity manager to update the existing data.

    This should run only once as a patch. Is there anything that is already in place in espo.

    It is preferable to run this code through ubuntu14.04 command line.

    Note: I have advanced pack
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    open for example extension.php
    here you can see, how to get Entity Manager. And after you can find needed entity, set needed value and save it.


    or with entity manager you have access to the PDO, and here you can run your mysql query ($entityManager->getPDO())

    Comment

    Working...