OpenMetadata/bootstrap/sql/migrations
Ram Narayan Balaji f418203338
Fix: Resolve v1.12.0 migration failure due to NULL workflow status (#25834)
* Fix: Resolve v1.12.0 migration failure due to NULL workflow status

  ## Root Cause Analysis
  - Migration failed when modifying entityLink column in workflow_instance_time_series
  - MySQL's ALTER TABLE MODIFY COLUMN re-validates ALL generated columns for ALL rows
  - Found 184+ workflow instances created between Dec 2024 - Jan 2025 with NULL status
  - These were created with pre-v1.7.0 code that didn't set status field in JSON
  - v1.7.0 added status column as GENERATED NOT NULL but old instances had NULL values
  - v1.12.0 migration triggered constraint validation, causing "Column 'status' cannot be null"

  ## Solution
  - Add UPDATE statements before ALTER TABLE in v1.12.0 migration
  - Set status='FINISHED' for workflows with endedAt (completed)
  - Set status='FAILED' for workflows without endedAt (incomplete)
  - Use two separate queries for better performance vs CASE statements
  - Handle both workflow_instance_time_series and workflow_instance_state_time_series

* failed to FAILURE status
2026-02-12 19:32:57 +05:30
..
flyway MINOR - Remove flyway (#23179) 2025-10-28 09:11:03 +05:30
native Fix: Resolve v1.12.0 migration failure due to NULL workflow status (#25834) 2026-02-12 19:32:57 +05:30