Add cursor batch as default BBM

What does this MR do and why?

Add cursor batch as default BBM

🔄 Automatic Cursor Detection

  • The BBM helper now automatically detects cursor-based jobs and uses min_cursor/max_cursor instead of min_value/max_value
  • The .cursor? method now returns true whenever cursor columns are present (not just for composite cursors)

🛠️ Generator & Template Updates

  • Migration generator templates now include comments indicating cursor strategy is the default
  • Added guidance on how to define the cursor method for custom cursor columns

🧪 Implementation Details

  • queue_batched_background_migration now calls calculate_max_cursor_values to compute max cursor values via ORDER BY on cursor columns
  • Updated job status logic: sets status to active when data exists, finished when table is empty

References

Closes #524103

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading