dev/release#16 - Make incremental upgrade steps optional
authorTim Otten <totten@civicrm.org>
Sat, 6 Mar 2021 08:20:21 +0000 (00:20 -0800)
committerTim Otten <totten@civicrm.org>
Sat, 6 Mar 2021 10:28:24 +0000 (02:28 -0800)
commitbd6c6256f82995689b07776be0170482f67b6f0c
treeae67d5c74b653e33c300c97b2b8498a9762be6cb
parentdbdba8f2139e2f8e345c7e7e08db856df58772d9
dev/release#16 - Make incremental upgrade steps optional

Often, when setting up the initial beta and when setting up the final stable
release, there are no upgrade steps.  However, we're required to create the
files anyway to ensure that the upgrader continues to work normally.

As a byproduct, we create a large number of empty incremental steps.  When
running the web-based upgrade, each incremental step requires 3x AJAX calls.
This adds up.

Before
-----------

The revision sequence -- and the final DB version-number -- are strictly
determined by the list of `X.Y.Z.mysql.tpl` files. If you omit a file,
then it will not execute corresponding PHP code, and it will not set
the final version in DB.

After
-----------

The revision sequence is more forgiving -- it will recognize any revision
number that is defined in either `X.Y.Z.mysql.tpl` or `function upgrade_X_Y_Z()`.

Additionally, it is not necessary for the final version number to appear in
the incremental revision list.

This patch enables a slightly different workflow for developing updates:

1. Set the new version in `xml/version.xml`.

2. If (and only if) you need some patch-level incremental work, then create
   a file `X.Y.Z.mysql.tpl` or create a function `function upgrade_X_Y_Z()`
   (or both).
CRM/Upgrade/Form.php