Add BEGIN/COMMIT transaction wrapper to migration to ensure atomicity and prevent partial migration failures.