fix: Add last_completed_partition column to migration_state table schema

The migration_state table was missing the last_completed_partition column
that was referenced in the migration update queries. This column tracks
which partition was last completed to enable accurate resume capability.

To apply this change to existing databases:
  ALTER TABLE migration_state ADD COLUMN last_completed_partition VARCHAR(255);

For new databases, the table will be created with the column automatically.
This commit is contained in:
2025-12-26 11:39:30 +01:00
parent ff0187b74a
commit 49dbd98bff
3 changed files with 161 additions and 1 deletions

View File

@@ -148,7 +148,8 @@ CREATE TABLE IF NOT EXISTS migration_state (
migration_started_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
migration_completed_at TIMESTAMP,
total_rows_migrated BIGINT DEFAULT 0,
status VARCHAR(32) DEFAULT 'pending'
status VARCHAR(32) DEFAULT 'pending',
last_completed_partition VARCHAR(255)
);
"""
return sql