I'm working on a (newer) PR for CRM-19751, which requires some database schema changes and addition of an option group with its options. Obviously I knew something about this when I created the original PR last year, but now can't seem to find documentation for such things as

  • How to get these code changes to actually perform the schema changes in my dev environment;
  • How to test (even manually, or else by some better method) that the upgrade script will work correctly;
  • The various directories/files in which I should be sure to make the changes (e.g., the appropriate DAO, xml/templates/civicrm_data.tpl, what else?)

So this question is not really to get an answer to the above points (though that would be helpful); rather it's to find out where this stuff is documented, or else where's the best place to ask someone about it?

2 Answers 2

  1. Change the appropriate file(s) under xml/schema so the tarballs are created properly.
  2. The data insert statements for the tarballs go in https://github.com/civicrm/civicrm-core/blob/master/xml/templates/civicrm_data.tpl as you mention.
  3. Create, or more likely edit, appropriately named file for version you are targeting PR to go into under https://github.com/civicrm/civicrm-core/tree/master/CRM/Upgrade/Incremental/sql. Your insert or alter commands for upgrading sites go in there.
  4. Very rarely, instead of or in addition to 3, you may want to put some php code into appropriately named file under https://github.com/civicrm/civicrm-core/tree/master/CRM/Upgrade/Incremental/php.
  5. Usually the schema changes are simple for the tarball and you need to worry about the upgrades working properly. Manual tests are all I know about. :(

HTH. If this works maybe submit it to a developer doc page.


I believe it would be the civix documentation, here https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-upgrader

But not sure about current test procedures.

  • Thanks, Demerit, but that seems to be for extensions, whereas I'm asking about core, which I'm pretty sure it's different.
    – TwoMice
    Sep 12, 2018 at 22:25
  • Ahh sorry. Then for who to ask you might try the chat at chat.civicrm.org to ask the core team.
    – Demerit
    Sep 12, 2018 at 23:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.