Draft: Add NOT NULL constraint for organization_id in scim_oauth_access_tokens

This is part of Add sharding key for `scim_oauth_access_tokens` (#553107) and a follow-up to the following MRs:

What does this MR do and why?

This MR adds a NOT NULL constraint on organization_id for the scim_oauth_access_tokens table to complete the Protocells compliance work.

This is the final MR in the series.

References

How to set up and validate locally

  1. Run the migration:
bundle exec rails db:migrate
  1. Verify the constraint exists:
ActiveRecord::Base.connection.execute(<<~SQL).to_a
  SELECT conname, pg_get_constraintdef(oid)
  FROM pg_constraint
  WHERE conrelid = 'scim_oauth_access_tokens'::regclass
  AND contype = 'c'
  AND pg_get_constraintdef(oid) LIKE '%organization_id IS NOT NULL%'
SQL

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Paulo Barros

Merge request reports

Loading