Follow-up from "Add `PagesDeployment` upload_ready field"
To ensure existing deployments are valid, we created the upload_ready
field as default: true
, using a post_migration to change it to default: false
.
Once that's deployed we must remove the code that ensures new deployments don't initialize with upload_ready: true
:
# app/services/projects/update_pages_service.rb:95
def pages_deployment_attributes(file, build)
{
file: file,
file_count: deployment_update.entries_count,
file_sha256: build.job_artifacts_archive.file_sha256,
ci_build_id: build.id,
root_directory: build.options[:publish],
upload_ready: false # < remove this line
}
end
# app/models/pages_deployment.rb
class PagesDeployment < ApplicationRecord
# ...
include SafelyChangeColumnDefault # < remove this line
columns_changing_default :upload_ready # < remove this line
# ...
end
Edited by Kassio Borges