Draft: Add empty directory as indicator that no batches were processed

What does this MR do and why?

References

Previously, if a migration was designed to process database records but the table was empty, the system would complete successfully but leave no trace that it had run. This made it difficult to track whether the migration had actually been executed or was skipped entirely.

The fix adds a counter to track how many data batches were processed, and if zero batches were handled (meaning the table was empty), it now creates an empty directory to serve as evidence that the migration ran successfully but simply had no work to do.

The accompanying tests verify this new behavior works correctly - ensuring that empty migrations create the tracking directory, while migrations that process data continue to work as before by creating batch-specific directories.

This improvement helps with migration tracking and debugging by providing clear evidence of all migration executions, regardless of whether they processed any data.

Part of Issue: gitlab-org/database-team/gitlab-com-database-testing#157

⚠️ This MR needs to be merged first: gitlab-org/database-team/gitlab-com-database-testing!315 which handles and empty BBM directory (that's why the MR is marked draft).

Edited by Allison Browne

Merge request reports

Loading