Add organization_id to keys table
What does this MR do and why?
This change adds organization support to SSH keys in the system. Previously, SSH keys were only associated with users, but now they're also linked to specific organizations.
The main updates include:
- Adding an "organization_id" field to the keys database table that connects each key to an organization
- Updating the code that creates new SSH keys (both deploy keys for projects and regular user SSH keys) to automatically assign them to the appropriate organization
- Setting up proper database relationships so keys belong to both a user and an organization
- Adding database indexes and constraints to ensure data integrity
- Updating test factories to include organization associations
This change appears to be part of a larger effort to organize the system around organizations, allowing better separation and management of resources. The migration sets a default organization (ID 1) for existing keys, ensuring backward compatibility while enabling the new organizational structure going forward.
References
- Fixes #553463 (closed)
Screenshots or screen recordings
Before | After |
---|---|
How to set up and validate locally
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 Aboobacker MK