Skip to content
Snippets Groups Projects
Unverified Commit 97e2c4f5 authored by colemanw's avatar colemanw Committed by GitHub
Browse files

Merge pull request #725 from demeritcowboy/regen

Document regen.sh
parents b60366ff 3e86ff5f
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,30 @@ CiviCRM has a complex Database structure which this chapter will examine in more
## Tools
Documentation on tools to interact with the CiviCRM Database still to come.
More documentation on tools to interact with the CiviCRM Database still to come.
### bin/regen.sh
If you are making a change that requires changes to the core schema, then in addition to any steps described at [XML Schema definition](https://docs.civicrm.org/dev/en/latest/framework/database/schema-definition/) you may need to also update the sql/civicrm_generated.mysql file which is used when installing CiviCRM with the option to include sample data.
If the change doesn't touch on other parts of the data or schema and doesn't affect any generated foreign key ids for example, you might be able to get away with just editing the file directly, which will avoid having to commit a lot of otherwise unrelated changes because the data in the file is semi-randomly generated. But if it is more complex or affects other parts of the file you need to use bin/regen.sh to regenerate it.
#### Setup
If you are using buildkit or have used setup.sh you may already be set up for it and may not need to do these steps.
1. While you can run this on an existing install that has the latest master code, you may either want to set up a separate install or make a backup of your database since it will get wiped. **Note: if you have your CMS and CiviCRM in the same database the CMS will get wiped too**.
1. Copy bin/setup.conf.txt to bin/setup.conf
1. Edit bin/setup.conf as needed.
1. If using Drupal, you will need drush installed and in your PATH.
1. (Optional) If you don't have /path/to/civicrm/node_modules/karma/bin in your PATH, add it. It's optional because it will still work, but you'll avoid it trying to reinstall karma. It's not used here anyway.
#### Running
1. Log out of your install if you are logged in.
1. Run bin/regen.sh from within your /path/to/civicrm folder.
It's a little difficult to verify the results by comparing to the previous file because of the deliberate randomness in the data, but you can compare the overall structure. You can also log back in to your install and check it out.
## Useful coding structures
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment