Add the organization_id
column to pool_repositories
What does this MR do and why?
- adds
organization_id
topool_repositories
withnull: true
- updates
gitlab/spec/db/schema_spec.rb
foreign key constraint list- the foreign key will be handled in a backfill migration that will come after this
Future MRs will add code support, backfill migrations, NOT NULL constraint, and model validations
migration output
be rake db:migrate
main: == [advisory_lock_connection] object_id: 155460, pg_backend_pid: 75395
main: == 20250929180950 AddOrganizationIdToPoolRepositories: migrating ==============
main: -- add_column(:pool_repositories, :organization_id, :bigint, {:null=>true})
main: -> 0.0404s
main: == 20250929180950 AddOrganizationIdToPoolRepositories: migrated (0.0457s) =====
main: == [advisory_lock_connection] object_id: 155460, pg_backend_pid: 75395
ci: == [advisory_lock_connection] object_id: 155460, pg_backend_pid: 75423
ci: == 20250929180950 AddOrganizationIdToPoolRepositories: migrating ==============
ci: -- add_column(:pool_repositories, :organization_id, :bigint, {:null=>true})
ci: -> 0.0050s
ci: == 20250929180950 AddOrganizationIdToPoolRepositories: migrated (0.0133s) =====
ci: == [advisory_lock_connection] object_id: 155460, pg_backend_pid: 75423
Related to #519615 (closed)
Edited by Hunter Stewart