chore: Enable AD_ChangeLog on WM_InOutBound tables#629
Open
EdwinBetanc0urt wants to merge 1 commit into
Open
Conversation
Enable ADempiere's native change log on the two outbound order tables (`WM_InOutBound` header and `WM_InOutBoundLine` lines) so that INSERT/UPDATE/DELETE operations are recorded per column with user, timestamp and old/new value. Diagnosing the recent duplicate outbound order incident (#1919) required reading application logs because no dictionary-level audit trail existed on these tables; this migration closes that gap and gives the ADempiere client a persistent, queryable history for future regressions.
## Summary
- Toggle `AD_Table.IsChangeLog = 'Y'` on `WM_InOutBound` (`AD_Table_ID = 53233`) and `WM_InOutBoundLine` (`AD_Table_ID = 53234`) using a `<PO Action="U">` step, so the rollback is implicit from the `oldValue="false"` attribute and no separate `RollbackStatement` is needed.
- Header-level audit (1 row per generation) is enough to detect the double-generation pattern reported in #1919 (two `Created` rows a few seconds apart on the same outbound order); line-level audit (N rows per generation) adds traceability against post-creation edits or SQL deletes on line quantities.
- `AD_ChangeLog` volume on the lines table scales with the number of selected order lines per generation; the migration's inline comment notes this so DBAs on high-throughput sites can plan a retention/purge policy before applying.
## Changes
- `xml/migration/1.5.13/00503670_D_1_5_13_Enable_ChangeLog_On_OutBound_Tables.xml` — new migration, `EntityType="D"`, `SeqNo="503670"`, two `<Step StepType="AD">` blocks updating `AD_Table.IsChangeLog` on the two records.
## Test plan
- [ ] Apply the migration on dyd-dev and check `SELECT IsChangeLog FROM AD_Table WHERE TableName IN ('WM_InOutBound','WM_InOutBoundLine')` returns `'Y'` for both.
- [ ] Generate an outbound order from the "Generar Orden de Salida" form and verify rows appear in `AD_ChangeLog` for both the header and each line (one row per audited column with `IsAllowLogging = 'Y'`).
- [ ] Edit a saved outbound order line quantity from the ZK window and verify the change is logged with `OldValue` / `NewValue`.
- [ ] Rollback the migration (`IsChangeLog` back to `'N'`) and verify pre-existing `AD_ChangeLog` rows are preserved (only new events stop being written).
- [ ] Sample `AD_ChangeLog` growth in dyd-dev for one busy day to size a retention/purge policy before applying to production.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable ADempiere's native change log on the two outbound order tables (
WM_InOutBoundheader andWM_InOutBoundLinelines) so that INSERT/UPDATE/DELETE operations are recorded per column with user, timestamp and old/new value. Diagnosing the recent duplicate outbound order incident (#1919) required reading application logs because no dictionary-level audit trail existed on these tables; this migration closes that gap and gives the ADempiere client a persistent, queryable history for future regressions.Summary
AD_Table.IsChangeLog = 'Y'onWM_InOutBound(AD_Table_ID = 53233) andWM_InOutBoundLine(AD_Table_ID = 53234) using a<PO Action="U">step, so the rollback is implicit from theoldValue="false"attribute and no separateRollbackStatementis needed.Createdrows a few seconds apart on the same outbound order); line-level audit (N rows per generation) adds traceability against post-creation edits or SQL deletes on line quantities.AD_ChangeLogvolume on the lines table scales with the number of selected order lines per generation; the migration's inline comment notes this so DBAs on high-throughput sites can plan a retention/purge policy before applying.Changes
xml/migration/1.5.13/00503670_D_1_5_13_Enable_ChangeLog_On_OutBound_Tables.xml— new migration,EntityType="D",SeqNo="503670", two<Step StepType="AD">blocks updatingAD_Table.IsChangeLogon the two records.Test plan
SELECT IsChangeLog FROM AD_Table WHERE TableName IN ('WM_InOutBound','WM_InOutBoundLine')returns'Y'for both.AD_ChangeLogfor both the header and each line (one row per audited column withIsAllowLogging = 'Y').OldValue/NewValue.IsChangeLogback to'N') and verify pre-existingAD_ChangeLogrows are preserved (only new events stop being written).AD_ChangeLoggrowth in dyd-dev for one busy day to size a retention/purge policy before applying to production.