Add seat_assignment_model namespace setting

What does this MR do and why?

Add a seat_assignment_model_enabled boolean column to namespace_settings. This will be used to determine whether the Seat Assignment Model is enabled for a namespace, and is a building block for the following MRs:

  • !249867 (merged) (Restrict invite search to seat assignment holders) — also introduces the seat_assignment_model feature flag
  • !249868 (Restrict invite creation to seat assignment holders)

Database review

  • Migration: db/migrate/20260812120000_add_seat_assignment_model_to_namespace_settings.rb adds a single non-nullable boolean column with a default to the existing namespace_settings table via add_column, no backfill required.
  • namespace_settings is documented as table_size: small in the database dictionary, so this is well within the 100 GB limit for new columns.
  • db:gitlabcom-database-testing has been triggered on the MR pipeline to validate the migration.

Migration Output

VERSION=20260812120000 bin/rails db:migrate:down:main
main: == [advisory_lock_connection] object_id: 162600, pg_backend_pid: 314427
main: == 20260812120000 AddSeatAssignmentModelToNamespaceSettings: reverting ========
main: -- remove_column(:namespace_settings, :seat_assignment_model_enabled, :boolean, {:default=>false, :null=>false})
main:    -> 0.0243s
main: == 20260812120000 AddSeatAssignmentModelToNamespaceSettings: reverted (0.0515s)

main: == [advisory_lock_connection] object_id: 162600, pg_backend_pid: 314427
VERSION=20260812120000 bin/rails db:migrate:up:main
main: == [advisory_lock_connection] object_id: 162620, pg_backend_pid: 320860
main: == 20260812120000 AddSeatAssignmentModelToNamespaceSettings: migrating ========
main: -- add_column(:namespace_settings, :seat_assignment_model_enabled, :boolean, {:default=>false, :null=>false})
main:    -> 0.0293s
main: == 20260812120000 AddSeatAssignmentModelToNamespaceSettings: migrated (0.0486s)

main: == [advisory_lock_connection] object_id: 162620, pg_backend_pid: 320860

References

Related to https://gitlab.com/gitlab-org/gitlab/-/work_items/605919

How to set up and validate locally

  1. Run migrations: bundle exec rails db:migrate
  2. bundle exec rspec spec/models/namespace_setting_spec.rb
Edited by Lukas Wanko

Merge request reports

Loading
Loading