Resolve "Remove Ultimate from recent public projects"
What does this MR do and why?
Disables ultimate features for public projects created on or after 2022-02-17 09:00.
Query plan
https://console.postgres.ai/gitlab/gitlab-production-tunnel-pg12/sessions/11357/commands/40664
Sample Raw SQL Query
UPDATE
"project_settings"
SET
"legacy_open_source_license_available" = FALSE
WHERE
"project_settings"."project_id" IN (
SELECT
"projects"."id"
FROM
"projects"
WHERE
"projects"."id" BETWEEN 10000 AND 25000
AND "projects"."visibility_level" = 20
AND (created_at > '2022-02-17')
AND "projects"."id" >= 10000
AND "projects"."id" < 10500
)
AND "project_settings"."legacy_open_source_license_available" = TRUE
Migration output
#up
bin/rails db:migrate:up:main VERSION=20220801155858
main: == 20220801155858 ScheduleDisableLegacyOpenSourceLicenceForRecentPublicProjects: migrating
main: == 20220801155858 ScheduleDisableLegacyOpenSourceLicenceForRecentPublicProjects: migrated (0.0006s)
#down
bin/rails db:migrate:down:main VERSION=20220801155858
main: == 20220801155858 ScheduleDisableLegacyOpenSourceLicenceForRecentPublicProjects: reverting
main: == 20220801155858 ScheduleDisableLegacyOpenSourceLicenceForRecentPublicProjects: reverted (0.0004s)
Reversability
This is a data migration that removes ultimate license from public projects created after 17/02/2022. Reversing it would not be straight and would require restoring data from an earlier snapshot.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #365100
Edited by Hitesh Raghuvanshi