ctsit / redcap_deployment

Scripted REDCap deployment tools at UF CTSI
BSD 3-Clause "New" or "Revised" License
5 stars 13 forks source link

update redcap_history_version at each install/upgrade #66

Open pbchase opened 4 years ago

pbchase commented 4 years ago

At each upgrade, REDCap upgrade.php script adds or replaces a row in redcap_history_version. the fab deploy and upgrade tasks do not do that, but should. The line from REDCap we need to imitate is

REPLACE INTO redcap_history_version (`date`, redcap_version) values (CURDATE(), '$redcap_version');

With variables substituted, that line loks like this:

REPLACE INTO redcap_history_version (`date`, redcap_version) values (CURDATE(), '9.3.5');

Look for code to steal at https://github.com/ctsit/redcap_deployment/blob/602cb1d26efd8a22c0ae0c841d11e3f5ddcf813f/utility_redcap.py#L95

pbchase commented 7 months ago

FYI, this is the current behavior:

-- Set date of upgrade --
UPDATE redcap_config SET value = CURDATE() WHERE field_name = 'redcap_last_install_date';
REPLACE INTO redcap_history_version (`date`, redcap_version) values (CURDATE(), '14.1.3');
-- Set new version number --
UPDATE redcap_config SET value = '14.1.3' WHERE field_name = 'redcap_version';