Draft: Migrate require_password_to_approve setting
What does this MR do and why?
Migrate require_password_to_approve setting
- Refs: #431346
Changelog: changed
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
❯ rails db:migrate
main: == [advisory_lock_connection] object_id: 128820, pg_backend_pid: 40037
main: == 20240709094545 BackfillRequirePasswordToReauthentication: migrating ========
main: == 20240709094545 BackfillRequirePasswordToReauthentication: migrated (0.0588s)
main: == [advisory_lock_connection] object_id: 128820, pg_backend_pid: 40037
ci: == [advisory_lock_connection] object_id: 129140, pg_backend_pid: 40039
ci: == 20240709094545 BackfillRequirePasswordToReauthentication: migrating ========
ci: -- The migration is skipped since it modifies the schemas: [:gitlab_main].
ci: -- This database can only apply migrations in one of the following schemas: [:gitlab_ci, :gitlab_internal, :gitlab_shared].
ci: == 20240709094545 BackfillRequirePasswordToReauthentication: migrated (0.0066s)
ci: == [advisory_lock_connection] object_id: 129140, pg_backend_pid: 40039
https://postgres.ai/console/gitlab/gitlab-production-main/sessions/29728/commands/92381
SELECT "project_settings"."project_id"
FROM "project_settings"
WHERE "project_settings"."require_reauthentication_to_approve" IS NULL
AND "project_settings"."project_id" >= 19
ORDER BY "project_settings"."project_id" ASC
LIMIT 1
OFFSET 100
Time: 4.404 ms
- planning: 1.228 ms
- execution: 3.176 ms
- I/O read: 2.905 ms
- I/O write: 0.000 ms
Shared buffers:
- hits: 24 (~192.00 KiB) from the buffer pool
- reads: 1 (~8.00 KiB) from the OS file cache, including disk I/O
- dirtied: 0
- writes: 0
https://postgres.ai/console/gitlab/gitlab-production-main/sessions/29728/commands/92360
SELECT "projects"."require_password_to_approve"
FROM "projects"
WHERE "projects"."id" = 19416940
LIMIT 1
Time: 3.941 ms
- planning: 3.882 ms
- execution: 0.059 ms
- I/O read: 0.000 ms
- I/O write: 0.000 ms
Shared buffers:
- hits: 5 (~40.00 KiB) from the buffer pool
- reads: 0 from the OS file cache, including disk I/O
- dirtied: 0
- writes: 0
https://postgres.ai/console/gitlab/gitlab-production-main/sessions/29728/commands/92339
UPDATE "project_settings"
SET "updated_at" = '2024-07-09 07:28:16.650229', "require_reauthentication_to_approve" = NULL
WHERE "project_settings"."project_id" = 19416940
Time: 8.658 ms
- planning: 0.814 ms
- execution: 7.844 ms
- I/O read: 7.376 ms
- I/O write: 0.000 ms
Shared buffers:
- hits: 17 (~136.00 KiB) from the buffer pool
- reads: 8 (~64.00 KiB) from the OS file cache, including disk I/O
- dirtied: 2 (~16.00 KiB)
- writes: 0
How to set up and validate locally
- run
rails db:migrate
in a terminal
Edited by Sam Figueroa