(REF) CRM_Core_CodeGen_Schema - Allow generating SQL without making files
authorTim Otten <totten@civicrm.org>
Wed, 22 Jan 2020 22:46:55 +0000 (14:46 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 28 Jan 2020 22:20:45 +0000 (14:20 -0800)
commit50b8ea3e511f1a35c37084133adf8c14c185baa4
tree6d410c78cba6f8f7e22d297f2d95ca2ca1c3cbdb
parent4d5b93c3343c75c9881a7b1193ffbf33b1e6439a
(REF) CRM_Core_CodeGen_Schema - Allow generating SQL without making files

Overview
--------

This is a refactoring to allow consumers of `CRM_Core_CodeGen_Schema` to
request the SQL without creating files.

Before
------

Calls to `CRM_Core_CodeGen_Schema::generateDropSql` (ad nauseum) create SQL files.

After
-----

Calls to `CRM_Core_CodeGen_Schema::generateDropSql` (ad nauseum) return SQL strings.

Comments
--------

To ensure that files are still generated consistently, you can use this procedure:

```
git checkout MY_BASE_BRANCH
./bin/setup.sh -g
cp -r sql sql.orig

git checkout MY_MODIFIED_BRANCH

rm sql/civicrm.mysql sql/civicrm_acl*mysql sql/civicrm_data*mysql sql/civicrm_drop.mysql sql/civicrm_navigation.mysql -f
./bin/setup.sh -g

colordiff -ru sql.orig sql
```
CRM/Core/CodeGen/Schema.php
CRM/Core/CodeGen/Util/Template.php