Update PagesDeployment deletion strategy to use `delete_at`
Currently, the deletion of deprecated pages deployments is based on the idea that each project must have only 1 active PagesDeployment
in a given moment. With the work to introduce Gitlab Pages Multiple Versions, a project now will have to support multiple PagesDeployment
at the same time.
For this reason, PagesDeployment#deleted_at
field was introduced to enable us to delete deprecated jobs by setting their deleted_at
to the minimal timestamp when it's safe to delete them from the database.
Now, we're replacing the DestroyPagesDeploymentsWorker
by Pages::DeprecatedDeploymentsDeleteCronWorker
which will delete all depreacted PagesDeployment
records, in other words, all PagesDeploymen
records that where deleted_at
is not in the future.
Edited by Kassio Borges