* remove tasks from the db that were removed in the migration
* ensure the correct number of cycles when we migrate a pi
* delete the tasks that spiff returns instead of calculating it in backend
---------
Co-authored-by: jasquat <jasquat@users.noreply.github.com>