Recreate foreign key ci_build_id in pages_deployments table
We plan to move ci_builds table to another database, which will make foreign keys impossible. We need to use looks foreign keys, see more in #338535 (closed)
According to &6289 (comment 629698982), we could have an orphaned
ci_build_id
inpages_deployments
table due to the missing FKs. ("orphaned" means the id exists in the column, but the actual row doesn't exit). We have to achieve the same cascading deletion/nullify data integration validity at application-level, meaning we have to adddependent: :delete_all/:destroy_all/:nullify
in the AR model accordingly.
Edited by Vladimir Shushlin