Skip to content

Set force_include_all_resources to default true in workspaces table

What does this MR do and why?

Set force_include_all_resources to default true in database

Related to #427122 (closed)

Using https://docs.gitlab.com/ee/development/database/avoiding_downtime_in_migrations.html#changing-column-defaults

Followup issue Clean up the SafelyChangeColumnDefault in works... (#427265 - closed)

Migration output

$ bin/rails db:migrate:up:main VERSION=20231004120426 RAILS_ENV=development
main: == [advisory_lock_connection] object_id: 226940, pg_backend_pid: 434348
main: == 20231004120426 ChangeWorkspacesForceIncludeAllResourcesDefault: migrating ==
main: -- change_column_default(:workspaces, :force_include_all_resources, {:from=>false, :to=>true})
main:    -> 0.0150s
main: == 20231004120426 ChangeWorkspacesForceIncludeAllResourcesDefault: migrated (0.0176s) 
main: == [advisory_lock_connection] object_id: 226940, pg_backend_pid: 434348

$ bin/rails db:migrate:down:main VERSION=20231004120426 RAILS_ENV=development
main: == [advisory_lock_connection] object_id: 226960, pg_backend_pid: 434985
main: == 20231004120426 ChangeWorkspacesForceIncludeAllResourcesDefault: reverting ==
main: -- change_column_default(:workspaces, :force_include_all_resources, {:from=>true, :to=>false})
main:    -> 0.0170s
main: == 20231004120426 ChangeWorkspacesForceIncludeAllResourcesDefault: reverted (0.0207s) 

main: == [advisory_lock_connection] object_id: 226960, pg_backend_pid: 434985

How to set up and validate locally

Use the migration stpes above.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Alper Akgun

Merge request reports