You need to sign in or sign up before continuing.
Add organization_id to the web_hooks table
Implementation Plan
-
Add an organization_id
column to theweb_hooks
table- Do not add a default value, as the intention is to only have the
organization_id
set for records which are organization wide.
- Do not add a default value, as the intention is to only have the
-
Add belongs_to :organization
to the WebHook model, along with any necessary validations or callbacks. Set theorganization_id
toOrganization.current
when creating newSystemHook
and system wideServiceHook
records. -
Create a post migration (or 2) to set the organization_id
to::Organizations::Organization.first.id
for all system hooks whereorganization_id
isnil
-
Create a multi column not null check so each hook has exactly 1 of organization_id
,project_id
orgroup_id
, and set these as the sharding keys. Addvalidates :organization_id, presence: true
toapp/models/hooks/system_hook.rb
-
remove web_hooks
table fromwork_in_progress
inspec/lib/gitlab/database/sharding_key_spec.rb
-
create issue to finalize the background migration
Edited by Carla Drago