Answers.Body: <ol>
  <li>Change the appropriate file(s) under xml/schema so the tarballs are created properly. </li>
  <li>The data insert statements for the tarballs go in <a href="https://github.com/civicrm/civicrm-core/blob/master/xml/templates/civicrm_data.tpl" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/blob/master/xml/templates/civicrm_data.tpl</a> as you mention.</li>
  <li>Create, or more likely edit, appropriately named file for version you are targeting PR to go into under <a href="https://github.com/civicrm/civicrm-core/tree/master/CRM/Upgrade/Incremental/sql" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/tree/master/CRM/Upgrade/Incremental/sql</a>. Your insert or alter commands for upgrading sites go in there.</li>
  <li>Very rarely, instead of or in addition to 3, you may want to put some php code into appropriately named file under <a href="https://github.com/civicrm/civicrm-core/tree/master/CRM/Upgrade/Incremental/php" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/tree/master/CRM/Upgrade/Incremental/php</a>.</li>
  <li>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. :(</li>
  </ol>
  
  <p>HTH. If this works maybe submit it to a developer doc page.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-10-16T02:23:01.303Z
Answers.LastActivityDate: 2018-10-16T02:23:01.303Z
Answers.UserDisplayName: Joe Murray
Answers.Body: <p>I believe it would be the civix documentation, here
  <a href="https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-upgrader" rel="nofollow noreferrer">https://docs.civicrm.org/dev/en/latest/extensions/civix/#generate-upgrader</a></p>
  
  <p>But not sure about current test procedures.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-12T22:25:34.197Z
Answers.Text: Thanks, Demerit, but that seems to be for extensions, whereas I'm asking about core, which I'm pretty sure it's different.
Answers.UserDisplayName: TwoMice
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-12T23:33:55.860Z
Answers.Text: Ahh sorry. Then for who to ask you might try the chat at chat.civicrm.org to ask the core team.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-09-12T21:36:24.203Z
Answers.LastActivityDate: 2018-09-12T21:36:24.203Z
Answers.UserDisplayName: Demerit
Body: <p>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</p>
  
  <ul>
  <li>How to get these code changes to actually perform the schema changes in my dev environment;</li>
  <li>How to test (even manually, or else by some better method) that the upgrade script will work correctly;</li>
  <li>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?)</li>
  </ul>
  
  <p>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?</p>
  
Tags: <database><developer><mysql><documentation>
Title: Where is the developer documentation for making core CiviCRM database changes, to the schema and to the initial data?
ThreadText: # Where is the developer documentation for making core CiviCRM database changes, to the schema and to the initial data?
  
  (Asked by: username_0 on 2018-09-12)
  
  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?
  
  **Tags:** database, developer, mysql, documentation
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-10-16. Score: 1
  
  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.
  
  
  ---
  
  ### Answer by username_2 on 2018-09-12. Score: 0
  
  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.
  
  > **Comments:**
  > **username_0**: Thanks, username_2, but that seems to be for extensions, whereas I'm asking about core, which I'm pretty sure it's different.  
  > **username_2**: Ahh sorry. Then for who to ask you might try the chat at chat.civicrm.org to ask the core team.  
  
  ---
  
  