Database schema migrations

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AlexH
    Junior Member
    • Aug 2023
    • 9

    Database schema migrations

    Hello,

    I am setting up a CI/ CD setup so that I can make customisations and test them before pushing to production.

    Most of these customisations affect the files only, but some also affect the database.

    Is there a way to run database schema migrations in EspoCRM, to bring the database up-to-date with changes made in the files?

    Thanks!
    Alex
  • yuri
    Member
    • Mar 2014
    • 8467

    #2
    Hi Alex,

    There's no migrations tool in Espo which provides schema versioning functionality. When you run `bin/command rebuild` it executes needed SQL queries to bring the database schema up to date.

    You could utilize Doctrine Migrations tool. As we use Doctrine DBAL, it should not be hard to integrate the existing schema generating framework with Doctrine Migrations.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • AlexH
      Junior Member
      • Aug 2023
      • 9

      #3
      Hi Yuri,

      Thanks for the answer. I'm not so interested in version controlling the database schema, just bringing the db schema up to date with the files as part of CI.

      'bin/command rebuild' did the trick, thanks!

      Have a nice weekend

      Comment

      Working...