Skip to main content

Module backup

Module backup 

Source
Expand description

Pre-migration backup for destructive steps.

DropColumn has no inverse step, so a plan containing drops can only be rolled back from a backup taken before execution. When the caller supplies a backup directory, the executor snapshots the affected rows first and rollback restores from that snapshot instead of failing outright.

Functionsยง

restore_backup
Restore a destructive plan from its backup. Returns None when no backup file exists for the plan.
write_backup
Snapshot rows touched by destructive steps. Returns the row count.