Closed totten closed 5 months ago
This looks good, although I find the difference between "auto" and "full" to be a bit confusing. Both modes will upgrade everything, so is there really a need for the distinction?
Cool. Glad it's merged.
... find the difference between "auto" and "full" to be a bit confusing ...
Yeah, unfortunately, the pre-existing protocols for CRM_Upgrade_Form
and CRM_Extension_Upgrades
don't do what one wants for a unified cv updb
. (There's disagreement on whether to proceed with execution when the DB/code versions already match. CRM_Upgrade_Form
protocol says to quit -- but cv updb
should continue with extension-upgrades.)
The mismatch means that some messiness is going to show up somehow. The $mode
is just a way to organize that bit of mess. The options are distinguished as:
auto
(normal): Do what a user actually expects from a unified DB upgrade command. (Upgrade core and/or extension, depending on what's pending.)full
: Follow the pre-existing protocol for CRM_Upgrade_Form
(as currently understood circa 5.74; with an extra compatibility step for <5.53).ext
: Follow the pre-existing protocol for CRM_Extension_Upgrades
(as currently understood circa 5.74)Binding $mode
to --mode
(with a default auto
) reflects an attitude favoring transparency. ("If $mode
has to exist, and if it makes a big difference in how the thing behaves, then $mode
should probably be visible/hackable.)
Before
cv updb
does not exist.cv ext:upgrade-db
runs the extension upgrades.cv upgrade:db
runs the core upgrade. Sometimes, it may also run extension upgrades:After
cv updb
is an alias forcv upgrade:db
cv ext:upgrade-db
is deprecatedcv upgrade:db
runs core and/or extension upgrades.--mode=full
.)--mode=ext
.)Comments
The traditional command
upgrade:db
has been more featureful -- it provides progress-indicators, verbose output, and resume/skip options... butext:upgrade-db
had none of these. With the combined command, these features are available in both contexts.