We're updating the issue view to help you get more done. 

RUN_MonitoredSyncDB.sh

Description

Implement a script to synchronize the database with latest migration scripts allowing aremote monitored way:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Intended process: 1. Customer executes bash RUN_MonitoredSyncDB.sh (folder can be specified as an optional parameter) 2. The program executes all pending scripts UNTIL an error is found When an error is found it register the output of the script in AD_Migration_Script.Script column The program stop the process informing the error 3. Vendor send a fix to the customer to integrate in the same folder Conditions: The script must have the same name as the script changing the suffix .sql by .001.fix - then .002.fix and so for example if 201811121420_IDEMPIERE-2648.sql fails, then Vendor must provide a file 201811121420_IDEMPIERE-2648.001.fix and send it to customer to integrate in the same folder as the sql failed if the 001.fix fails then it can provide a 002.fix and keep going until the error is solved It is expected that the script 001.fix always end registering calling register_migration_script and also cleaning the Error status from the script that is fixing via update, for example: script 201811121420_IDEMPIERE-2648.001.fix is expected to end with these two lines: UPDATE AD_MigrationScript SET Status='IP' WHERE Name='201811121420_IDEMPIERE-2648.sql'); SELECT register_migration_script('201811121420_IDEMPIERE-2648.001.fix') FROM dual; and similar the script 201811121420_IDEMPIERE-2648.002.fix is expected to end with these two lines: UPDATE AD_MigrationScript SET Status='IP' WHERE Name='201811121420_IDEMPIERE-2648.001.fix'); SELECT register_migration_script('201811121420_IDEMPIERE-2648.002.fix') FROM dual; and so on 4. If there is an email registered in AD_System.SupportEMail and there is an accessible sendmail program then this script tries to send an email to that support informing the error 5. All the above steps are intended to be executed initially in a test or stage environment When executed again on a clean environment, or applied in production, the script automatically applies the fixes and continue

Environment

None

Status

Assignee

Carlos Ruiz

Reporter

Carlos Ruiz

Labels

Tested By

None

Fix versions

Priority

Major